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: 
Anonymous
Not applicable

Expression conditional

Hello,

I have the expression sum(sales).

i want to add the following formula if(variable=1,sum(sales)), however with this formula it only applies for the month that variable =1. i would like the expression to calculate the sales for all months if for one month the variable =1.

Thank you

24 Replies
sunny_talwar

Like this?

Capture.PNG

Expression:

If(Max(TOTAL Registration) = 1, Sum({<Date, CLIENT = p(CLIENT)>}Sales), Sum(Sales))

Anonymous
Not applicable
Author

¿Can you explain me how did you do that?

i am going to reload with all my data.

i will tell you soon

sunny_talwar

Basically used a set analysis which ignores selection in Date field, but only shows the possible values of clients based on your date selection

If(Max(TOTAL Registration) = 1, Sum({<Date, CLIENT = p(CLIENT)>}Sales), Sum(Sales))

Anonymous
Not applicable
Author

thank you very much!!!

it is exactly what i needed.

one more cuestilon. what does client =p(client) do?

sunny_talwar

Look at my response above, I just explained it above. If you got what you wanted, please close this thread by marking correct and helpful responses.

Qlik Community Tip: Marking Replies as Correct or Helpful

Thanks,

Sunny