Skip to main content
Solved

Want PQL query like get total number of ID's which having only Pass. If having both pass and fail in it those ID's shouldn't consider. Only consider the ID's which having Pass in all rows of a particular Id.Answer should be 2

  • December 21, 2023
  • 2 replies
  • 2 views

Forum|alt.badge.img+4

MicrosoftTeams-image (6)

Best answer by connor.manth

You could convert the Pass/Fail to 1/0, and turn that formula into a KPI.

 

Then do something like:

 

CASE WHEN

PU_SUM(ID, KPI(q_check))/PU_COUNT(ID,KPI(qcheck)) = 1

THEN

'All Pass'

Else

'Fail'

END

 

I'm not sure about your table structure. But you'd have to use a DOMAIN_TABLE(ID) in the PU-Functions above if everything is one one table.

2 replies

connor.manth
Level 4
Forum|alt.badge.img
  • Level 4
  • 9 replies
  • Answer
  • December 21, 2023

You could convert the Pass/Fail to 1/0, and turn that formula into a KPI.

 

Then do something like:

 

CASE WHEN

PU_SUM(ID, KPI(q_check))/PU_COUNT(ID,KPI(qcheck)) = 1

THEN

'All Pass'

Else

'Fail'

END

 

I'm not sure about your table structure. But you'd have to use a DOMAIN_TABLE(ID) in the PU-Functions above if everything is one one table.


bunyod.sap
Level 7
Forum|alt.badge.img
  • Level 7
  • 32 replies
  • December 28, 2023

I agree with @connor.manth. After Counting, I would apply a component filter something like...

 

FILTER PU_COUNT(DOMAIN_TABLE("Table"."ID"), "Table"."Activity", "Table"."Timestamp", "Table"."q_check" IN_LIKE ('Fail')) = 0;

 

It means, if there will be 'Fail' in of the IDs, that ID should be ignored. In your example above, in ID=2 there is one Fail and one Pass, with this logic ID=2 should be completely excluded.