- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2020 07:00 AM
Hi Gurus,
Is it possible to retrieve data that has an updated date equal to Yesterday AND two days ago AND three days ago.
I see there are built-in options for today, yesterday, last 7 days etc, but that goes back to far. I just need for the past three days.
Let me know if you think this is possible.
Thanks,
Rob
Solved! Go to Solution.
- Labels:
-
Analytics and Reports

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-14-2020 06:47 AM
try now
usrCount = new GlideRecord("sn_imt_quarantine_unanswered_health_status_user");
usrCount.addEncodedQuery('u_unanswered_dateRELATIVELT@dayofweek@ago@3^u_unanswered_dateRELATIVEGT@dayofweek@ago@4');
usrCount.query();
var userArray = [];
while(usrCount.next()){
usrCount2 = new GlideRecord("sn_imt_quarantine_unanswered_health_status_user");
usrCount2.addEncodedQuery('u_unanswered_dateRELATIVELT@dayofweek@ago@2^u_unanswered_dateRELATIVEGT@dayofweek@ago@3^u_person=usrCount.u_person.name');
usrCount2.query();
while(usrCount2.next()){
gs.log('here1');
gs.log(usrCount2.u_person.name);
userArray.push(usrCount.sys_id.toString());
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2020 09:15 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2020 09:23 AM
Hi Rjb,
You have added the wrong condition as it should be
Unanswered Date -- relative ---- on or After ------- 3 days ago
Please update this and test.
Please mark answer correct and helpful.
Thanks,
CB
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2020 09:26 AM
As per the condition given 'on or before', the results are correct. Please check the condition again.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2020 10:19 AM
The example below is of someone that does not have a record for 6/11, so no records should show up..however records are. This is using the 'on or after' 3 day criteria.
The expected result is to show only records if they have ALL records for each of the past three days ONLY. If missing 1 day, bring back nothing.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2020 10:28 AM
Hi Rjp,
So in that case you want the records only if they have updated on all the three days so in that case you have to put all the conditions in AND case as follows:
Updated --- relative --- on-------- 2 days ago
Updated ----- relative --on -------3 days ago
updated ---- on------ yesterday
Please mark answer correct and helpful.
Thanks,
CB