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
  • ...own above. That filter alone looks like the below code. In the below code, the rule P360_RULE_Conversion_dateToDatetime is basically doing the same as userdatetime(). So my question is if anyone has another solution to the problem presented here or if this is the best way of doing it. Let me know if I need to clarify what the problem and my solution is.

    if(
    and(
    ri!startDatetimeMin = ri!startDatetimeMax,
    or(
    not(
    isnull(
    ri!startDatetimeMin
    )
    ),
    not(
    isnull(
    ri!startDatetimeMax
    )
    )
    )
    ),
    a!queryFilter(
    field: ri!fieldName,
    operator: "between",
    value: {
    rule!P360_RULE_Conversion_dateToDatetime(
    date: ri!startDatetimeMin,
    hour: 0,
    minute: 0,
    second: 0
    ),
    rule!P360_RULE_Conversion_dateToDatetime(
    date: ri!startDatetimeMax,
    hour: 23,
    minute: 59,
    second: 59
    )
    }
    ),
    {
    if...
Reply
  • ...own above. That filter alone looks like the below code. In the below code, the rule P360_RULE_Conversion_dateToDatetime is basically doing the same as userdatetime(). So my question is if anyone has another solution to the problem presented here or if this is the best way of doing it. Let me know if I need to clarify what the problem and my solution is.

    if(
    and(
    ri!startDatetimeMin = ri!startDatetimeMax,
    or(
    not(
    isnull(
    ri!startDatetimeMin
    )
    ),
    not(
    isnull(
    ri!startDatetimeMax
    )
    )
    )
    ),
    a!queryFilter(
    field: ri!fieldName,
    operator: "between",
    value: {
    rule!P360_RULE_Conversion_dateToDatetime(
    date: ri!startDatetimeMin,
    hour: 0,
    minute: 0,
    second: 0
    ),
    rule!P360_RULE_Conversion_dateToDatetime(
    date: ri!startDatetimeMax,
    hour: 23,
    minute: 59,
    second: 59
    )
    }
    ),
    {
    if...
Children
No Data