Skip to main content
Solved

[PQL]I would like to count firstest date among specific activities.

  • April 5, 2023
  • 3 replies
  • 116 views

Forum|alt.badge.img+4

Hi all,

​

I have a problem about how to write PQL, please check following conditions and please let me know how to write it.

​

My process flow like this

  1. Process start
  2. (some activities here)
  3. work start
    1. work start of A task
    2. work start of B task
    3. work start of C task
  4. (some activities here)
  5. Process end

​

and what I concern is #3 workstart, that has some branch and it might be in no particular order and combination is exist, so it might move 3-1 to 3-3 or 3-2 to 3-1, and I would like to get firstest work start time of work start.

 

So I think it might be work if I can filter in specific activity name, then sort the date ascending and select distinct of its value but I don't know how to do it in PQL.

 

Can anybody let me know how to do it?

Best answer by anna.moro

Hi @jumbo.szk ,

 

have you tried this? The below should give you the first date of any of the "work start..." activities, for each case.

 

PU_FIRST("Case_table","ActivityTable"."TIME", "ActivityTable"."Activity" IN_LIKE ('work start of A',work start of 'B','work start of C'), ORDER BY "ActivityTable"."TIME" ASC)

3 replies

  • Level 6
  • April 5, 2023

Hi @jumbo.szk ,

I think you can use the PU_FIRST along with FILTER condition and ORDER BY arguments to get the timestamp accordingly.

Link for reference : PU_FIRST

Thank you :)

Shravya B


Forum|alt.badge.img+4
  • Author
  • Level 8
  • April 5, 2023

Hi @jumbo.szk ,

I think you can use the PU_FIRST along with FILTER condition and ORDER BY arguments to get the timestamp accordingly.

Link for reference : PU_FIRST

Thank you :)

Shravya B

Hi @shravya.b11,

 

Thanks for your reply and actually I tried pu_min once but filter doesn't work(The displaied value is the same as all activity count.)

Is there any mistake in below PQL?

 

Count(

 PU_MIN (

  "Case_table", 

  "ActivityTable"."TIME" ,

  "ActivityTable"."Activity" in ('work start of A',work start of 'B','work start of C')

)

)


  • Level 2
  • Answer
  • April 5, 2023

Hi @jumbo.szk ,

 

have you tried this? The below should give you the first date of any of the "work start..." activities, for each case.

 

PU_FIRST("Case_table","ActivityTable"."TIME", "ActivityTable"."Activity" IN_LIKE ('work start of A',work start of 'B','work start of C'), ORDER BY "ActivityTable"."TIME" ASC)