Skip to main content

Hello,

  • May 16, 2023
  • 2 replies
  • 5 views

rene.szere
Level 2

Hello,

 

I have an activity "OCH_Activities". "Source_Queue_TXT" and "OCH_Activities". "Target_Queue_TXT".

I want if source and target are the same, that I get the value 1 for example.

I have already tried 

COUNT( CASE WHEN "OCH_Activities". "Source_Queue_TXT" = "OCH_Activities". "Target_Queue_TXT" THEN 1 ELSE 0 END)

but this does not compare the two activities. What would be the correct approach here.

Thanks

2 replies

andré.tafur
Level 8
Forum|alt.badge.img+15

Hello Rene,

If I understand your problem, your current CASE WHEN query yields the same result without taking into account the IF right? To take into account your IF you should replace the COUNT function by the SUM function, so the PQL will select only the cases where the equality between the activities is fulfilled.

 

SUM( CASE WHEN "OCH_Activities". "Source_Queue_TXT" = "OCH_Activities". "Target_Queue_TXT" THEN 1 ELSE 0 END)

 

I hope this is helpful.


rene.szere
Level 2
  • Author
  • Level 2
  • May 17, 2023

Thank you for your support. It works