I am using a!queryProcessAnalytics() to get data from a portal report.

I am using a!queryProcessAnalytics() to get data from a portal report. In SAIL, I have a From Start Date and To Start Date. These fields are going to query c8 = startDateTime from the portal report which is a DateTime! The search criteria are Date and c8 is a DateTime. I was having a few issues when the user, for example, typed 6/15/2016 to 6/15/2016 (The same dates). This wasn't returning the results as expected. What I had to do was to make it in the backend like this: 6/15/2016 0:0:0 to 6/15/2016 23:59:59. To accomplsh this I had to use the userdatetime() rule to convert the date to datetime. For example, to convert 6/15/2016, I would do userdatetime(year(ri!date), month(ri!date), day(ri!date), 0,0,0) to userdatetime(year(ri!date), month(ri!date), day(ri!date), 23,59,59) where ri!date = 6/15/2016.

This means that on the filters of the a!queryProcessAnalytics(), instead of using directly the ri!date, I used the rule as sh...

OriginalPostID-218397

  Discussion posts and replies are publicly visible

Parents
  • @erickp: For a similar scenario we are using rule as given below. Almost same as what you have done. We just made it generic to call from multiple reports. All our reports have start and end date filter and we face similar issue when user selects same date.

    Rule: Report_getConvertedStartDateTime

    /* -- inputDate_dte rule input is of type DATE -- */

    with(
    \tlocal!formattedDate: text(ri!inputDate_dte, "mm/dd/yyyy HH:mm z"),
    \tlocal!splitFr: split(split(split(local!formattedDate, " "),"/"),":"),
    \tuserdatetime(
    \ tlocal!splitFr[3],
    \ tlocal!splitFr[1],
    \ tlocal!splitFr[2],
    \ tlocal!splitFr[4],
    \ tlocal!splitFr[5],
    \ t"00"
    \t)
    )

    =========================

    Rule: Report_getConvertedEndDateTime

    /* -- inputDate_dte rule input is of type DATE -- */

    with(
    \tlocal!formattedDate: text(ri!inputDate_dte, "mm/dd/yyyy HH:mm z"),
    \tlocal!splitFr: split(split(split(local!formattedDate, " "),"/"),":"),
    \tuserdatetime(
    \ tlocal!splitFr[3],
    \ tlocal!splitFr[1],
    \ tlocal!splitFr[2],
    \ tlocal!splitFr[4],
    \ tlocal!splitFr[5],
    \ t"00"
    \t) + intervalds(23, 59, 0)
    )
Reply
  • @erickp: For a similar scenario we are using rule as given below. Almost same as what you have done. We just made it generic to call from multiple reports. All our reports have start and end date filter and we face similar issue when user selects same date.

    Rule: Report_getConvertedStartDateTime

    /* -- inputDate_dte rule input is of type DATE -- */

    with(
    \tlocal!formattedDate: text(ri!inputDate_dte, "mm/dd/yyyy HH:mm z"),
    \tlocal!splitFr: split(split(split(local!formattedDate, " "),"/"),":"),
    \tuserdatetime(
    \ tlocal!splitFr[3],
    \ tlocal!splitFr[1],
    \ tlocal!splitFr[2],
    \ tlocal!splitFr[4],
    \ tlocal!splitFr[5],
    \ t"00"
    \t)
    )

    =========================

    Rule: Report_getConvertedEndDateTime

    /* -- inputDate_dte rule input is of type DATE -- */

    with(
    \tlocal!formattedDate: text(ri!inputDate_dte, "mm/dd/yyyy HH:mm z"),
    \tlocal!splitFr: split(split(split(local!formattedDate, " "),"/"),":"),
    \tuserdatetime(
    \ tlocal!splitFr[3],
    \ tlocal!splitFr[1],
    \ tlocal!splitFr[2],
    \ tlocal!splitFr[4],
    \ tlocal!splitFr[5],
    \ t"00"
    \t) + intervalds(23, 59, 0)
    )
Children
No Data