Skip to main content
Question

Could you please help me to define PQL formula for the below use case?Average time( When count(WI of a DOCID)>2 then 0When count(WI of a DOCID)=2 then END_DATE - START-DATE of highest WIELSE END_DATE - START-DATE)

  • December 11, 2022
  • 1 reply
  • 1 view

deepak.kumar30
Level 3
Could you please help me to define PQL formula for the below use case? Average time( When count(WI of a DOCID)>2 then 0 When count(WI of a DOCID)=2 then END_DATE - START-DATE of highest WI ELSE END_DATE - START-DATE )

1 reply

abhishek.chatu14
Level 11
Forum|alt.badge.img+4

You cannot have AVG and then an aggregate function like COUNT. This will be something very complicated to achieve in the frontend (PQL), my suggestion would be do this calculation in the backend and not in PQL