Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
samuel_brierley
Creator
Creator

Set analysis

Hi all,

I have the below table which has Raised month as the dimension and various expressions.

the last 2 expressions use the same method but don't work as you can see.

=count({<Clearance_Month = {"$(=Raised_Month)"} >} Clearance_Month)

if I filter down to that month it works fine.

I know the reason for this (because when no filter is applied Raised_Month has multiple values) I did think however that because the Raised_month was the dimension it would this out but no.

hopefully you understand what im talking about and lightbulb shines and you have the answer, id be very grateful.

4 Replies
pokassov
Specialist
Specialist

sum(if(Clearance_Month = Raised_Month,1,0))

samuel_brierley
Creator
Creator
Author

always so obvious when somebody shows you.

can you please advise of the correct syntax for handling and or within the if statement?

thanks

=count({<Clearance_Month = {"$(=Raised_Month)"},Fault_Classification = {'0','1','2','7'},Fault_Code = {'-1','2','3','5','8','9','11','12','13','14','15','16','25','27'}>} Fault_Code)

samuel_brierley
Creator
Creator
Author

by that I mean is there a simpler way than the really long winded way?

rubenmarin

Hi Samuel, Fault_Classification and Fault_code are static, so they can stay in set analysis, using Sergey proposal it can be:

sum({<Fault_Classification = {'0','1','2','7'},Fault_Code = {'-1','2','3','5','8','9','11','12','13','14','15','16','25','27'}>} if(Clearance_Month = Raised_Month,1,0))