Custom Charts - how to query only last 6 months of data?

kani1
Kilo Contributor

Hi,

I have a custom report created   which shows the report sine the beginning. I want to modify this to show only last 6 months of data. Is there a way to do this? Please help me.

1 ACCEPTED SOLUTION

If you are using SummaryTableWriter to query data, try using encoded string as below.



opened.setQuery("opened_at>javascript:gs.daysAgoEnd(30)");


View solution in original post

11 REPLIES 11

Try removing the AND after the first caret - as below.



opened.setQuery("opened_at>javascript:gs.daysAgoEnd(70)^ANDcompany.nameSTARTSWITHname1^ORcompany.nameSTARTSWITHname2^ORcompany.nameSTARTSWITHname3");



Thanks,


Ajit


rcm
Kilo Contributor

Ajit - found another way.



Actually ran the query in Servicenow and then chose - show query.



Used the query to eliminate all companies I didn't want to see by choosing Filter out



Looks something like



(resolved_at>javascript:gs.daysAgoEnd(70)^company!=42fa201e0fb8c200118dfa6ce1050e40^ORcompany=NULL^company!=badbf68e0f4102001e9f079ce1050ed7^ORcompany=NULL^company!=8b9b201e0fb8c200118dfa6ce1050e12^ORcompany=NULL^company!=9d9303ce0f4102001e9f079ce1050e2c^ORcompany=NULL^company!=8982eefb0fc80200118dfa6ce1050ee")