Skip to main content
Question

Jinja Expression for Duration (Days) > 100

  • June 22, 2023
  • 0 replies
  • 133 views

Forum|alt.badge.img+6

Working a seeming simple pipeline to search casework, where [case age] is greater than 100 days. [case age] is a duration between two dates expressed in Days.

In the pipeline, when querying the search records

The results are much more than expected. When reviewing the pipeline activity logs, I can see the case_age is not in the same format as 123 Days.

logs show -
status:"O-In-Progress"
case_age:108862912
Clearly, pipelines doesn't recognized duration values as simple numerical values.
I cannot seem to master the correct expression that evaluates to "True"

Any help in this matter would be appreciated.



------------------------------
Thank you,
Chuck
------------------------------
This topic has been closed for replies.

Forum|alt.badge.img+20
  • Registered
  • June 22, 2023

Is your duration set to always be in days? If so, I would create a new formula numeric field: [Duration as Number].

Though it might seem like ToNumber([Case Age]) should work, I believe that will give you an error. I believe you need to use: ToDays([Case Age]). Then use that new formula numeric field in your query.

I am sure there is a also a fancy way to do it in Pipelines with an Advanced Query written in Jinja, but that is over my head!



------------------------------
Mike Tamoush
------------------------------

Forum|alt.badge.img+15
  • Registered
  • June 23, 2023

Chuck,

Duration fields are natively in milliseconds.   Try using a value of 

144000000

 



------------------------------
Don Larson
------------------------------