Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
ClareChinonye
Contributor III
Contributor III

Count with condition

Hi, please i am trying to count the worksorder where the actualtime/60 is >=  to the setuptime/60. this is the expression i wrote for my kpi chart, but the result is incorrect.

Count(distinct{<[UDEF_VIEW_service_event.WorksOrder]>}
If((TaskActualSetupTime/60) >= (TaskPlannedSetupTime/60), 1, 0)
)

 

can someone please help me out.

Labels (1)
7 Replies
MayilVahanan

Hi

Try like below

Sum({<[UDEF_VIEW_Ringtons_service_event.WorksOrder]=>}
If((TaskActualSetupTime/60) >= (TaskPlannedSetupTime/60), 1, 0)
)

 

Hope you have TaskActualSetupTime and TaskPlannedSetuptime are dimension.. 

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
ClareChinonye
Contributor III
Contributor III
Author

I got same incorrect figure i was getting before. they are both separate dimensions

MayilVahanan

Could you share the screenshot and expected output..

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
ClareChinonye
Contributor III
Contributor III
Author

Forum.png

ClareChinonye
Contributor III
Contributor III
Author

from the table, my count should equal 3, but i am getting 34

Dataintellinalytics

When you do count in a KPI you have to Group by on some dimension to get correct results.

Please share mocked up data and expected result.

MayilVahanan

Hi

So you're using in KPI object.. 

Sum(Aggr(Sum({<[UDEF_VIEW_Ringtons_service_event.WorksOrder]=>}
If((TaskActualSetupTime/60) >= (TaskPlannedSetupTime/60), 1, 0)
), TaskActualSetupTime, TaskPlannedSetupTime))

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.