Can anyone help to understand the below query

akhila13
Tera Expert

gr.addEncodedQuery('state!=4^sys_created_onRELATIVEGT@dayofweek@ago@'+days+'^sys_created_onRELATIVELT@dayofweek@ago@'+(days - 1));

7 REPLIES 7

Mark Roethof
Tera Patron
Tera Patron

Hi there,

Here a graphical representation of your filter. The circled number of days would be in your filter the + days + part. For testing I just entered two numeric values (5 and 10).

In my example I don't have a State 4, so just look this up. Which State in your case, has value 4?

find_real_file.png

If my answer helped you in any way, please then mark it as helpful.

Kind regards,
Mark
2020 ServiceNow Community MVP
2020 ServiceNow Developer MVP

---

LinkedIn
Community article list

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

Subhojit Das
Kilo Guru

Hi Akhila,

Please go through the below content.

('state!=4 ----> state is not equal to <choice value> (4)
^ ---> AND operator
sys_created_onRELATIVEGT@dayofweek@ago@'+days+' ----> created(sys_created_on) is relative(Relative) after(GT) Days(day of week) ago (ago)
^ ---> AND operator
sys_created_onRELATIVELT@dayofweek@ago@'+(days - 1)) -----> created(sys_created_on) is relative(Relative) before(LT) Days(day of week) ago(ago)

 

Regards,

Subhojit Das

Mark Roethof
Tera Patron
Tera Patron

Hi there,

Did this solve your question? Or do we need to follow-up on this?

Please mark this answer as correct if it solves your question. This will help others who are looking for a similar solution. Also marking this answer as correct takes the post of the unsolved list.
Thanks.

Kind regards,
Mark
2020 ServiceNow Community MVP
2020 ServiceNow Developer MVP

---

LinkedIn
Community article list

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

Mark Roethof
Tera Patron
Tera Patron

Hi there,

Did this solve your question? Or do we need to follow-up on this?

Please mark this answer as correct if it solves your question. This will help others who are looking for a similar solution. Also marking this answer as correct takes the post of the unsolved list.
Thanks.

Kind regards,
Mark
2020 ServiceNow Community MVP
2020 ServiceNow Developer MVP

---

LinkedIn
Community article list

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn