- 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:25 PM
I got it..
userArray has the sys_Id and you are passing this sys_Id to a Person Name.
Instead you have to try passing the Name to Person Name which will return the records.
Try running your script in script - Background by printing userArray[0] value and make sure the result shows name instead of '0b34XXXXXXX'.
Regards,
Sravan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2020 09:58 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2020 06:49 AM
Your Script Include name should be get3DaysAgoData. Please remove brackets () at the end of script include name and try again.
Please Mark it Correct & Helpful if it helps you.
Regards,
Sravan.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2020 11:30 AM
I don't know why it doesn't pick up yesterdays transactions, could it have something to do with date formats are not compatable?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2020 11:39 AM
Hi Rjp,
I guess its something related to timezone difference.Because for me its showing the report as working fine.
And yes the date time format might be the issue and timezone difference.
The filter is correct as i tested in my PDI. There must be data issue in your instance.
Can you check for other days( 4 days, 3days and 2 days ) it must come.
Please mark my answer Correct and Helpful.
Thanks,
CB
Thanks,
CB