Skip to main content

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

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.


Thank you for your support. It works


Reply