Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Expersion if a month is selected and if more than one is selected??

Hi Guys, I have this expresion in a bar chart:

=if(Count(DISTINCT Mes) = 1 ,

if(EDO_FIN = 'RESULTADOS', ((sum([Desv Abs])/TC)/1000),
if(EDO_FIN = 'BALANCE',    ((sum([Total períodos de informe])/TC)/1000),

if(EDO_FIN = 'RESULTADOS', ((sum([Desv Abs])/Avg(TC))/1000),
if(EDO_FIN = 'BALANCE',    ((sum([Total períodos de informe])/Avg(TC))/1000),0)))))

Mes means Month, what I need is that if I select just one month gives me the first 2 IF statements, and if more than one month is selected gives me the send pair of IF statement, I attahced the app for a better understand.

Any Ideas??

Thank you all!!

1 Solution

Accepted Solutions
Not applicable
Author

Hi Bosssssss

can you try this condition

=if(GetPossibleCount(Mes) = 1 ,

if(EDO_FIN = 'RESULTADOS', ((sum([Desv Abs])/TC)/1000),

if(EDO_FIN = 'BALANCE',    ((sum([Total períodos de informe])/TC)/1000))),

if(GetPossibleCount(Mes) <> 1,

(if(EDO_FIN = 'RESULTADOS', ((sum([Desv Abs])/Avg(TC))/1000),

if(EDO_FIN = 'BALANCE',    ((sum([Total períodos de informe])/Avg(TC))/1000),0)))))

View solution in original post

3 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

Hi

Don't know your data model of course, but perhaps TC = Avg(TC) when Mes = 1? In that case you don't need two sets of expressions, just

sum([Desv Abs])/Avg(TC)/1000

and

sum([Total períodos de informe])/Avg(TC))/1000

Regards

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable
Author

Hi jonathan, thanks for your reply, but, I really need this conditions, if I select just one month I need the fisrt 2 IF statements if more than one month is selected I need the Second statement.

Not applicable
Author

Hi Bosssssss

can you try this condition

=if(GetPossibleCount(Mes) = 1 ,

if(EDO_FIN = 'RESULTADOS', ((sum([Desv Abs])/TC)/1000),

if(EDO_FIN = 'BALANCE',    ((sum([Total períodos de informe])/TC)/1000))),

if(GetPossibleCount(Mes) <> 1,

(if(EDO_FIN = 'RESULTADOS', ((sum([Desv Abs])/Avg(TC))/1000),

if(EDO_FIN = 'BALANCE',    ((sum([Total períodos de informe])/Avg(TC))/1000),0)))))