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: 
george456
Creator
Creator

If statement with set analysis

I am trying with a variable and If statement to render a bubble graph based on selections. I get all to work except the below syntax:

 

=if($(vSelect)=1,(sum(if(Year2Date(PERIOD,0,if(MONTH(LatestDate)>11,1,MONTH(LatestDate)+1),LatestDate),$(vMeasure)))/
(sum(TOTAL(if(Year2Date(PERIOD,0,if(MONTH(LatestDate)>11,1,MONTH(LatestDate)+1),LatestDate),$(vMeasure))))))),

 

if($(vSelect)=2,(SUM(IF(Year2Date(PERIOD,0,1,LatestDate),$(vMeasure)))/SUM(TOTAL(IF(Year2Date(PERIOD,0,1,LatestDate),$(vMeasure))))))

What am I missing ? 

kindly advise

Regards

 

 

1 Solution

Accepted Solutions
CELAMBARASAN
Partner - Champion
Partner - Champion

Try this

=if($(vSelect)=1,(sum(if(Year2Date(PERIOD,0,if(MONTH(LatestDate)>11,1,MONTH(LatestDate)+1),LatestDate),$(vMeasure)))/
(sum(TOTAL(if(Year2Date(PERIOD,0,if(MONTH(LatestDate)>11,1,MONTH(LatestDate)+1),LatestDate),$(vMeasure)))))),


if($(vSelect)=2,(SUM(IF(Year2Date(PERIOD,0,1,LatestDate),$(vMeasure)))/SUM(TOTAL(IF(Year2Date(PERIOD,0,1,LatestDate),$(vMeasure)))))))

 

Nested if should be like this

= If( Condition1, Exp1 , If(Condition1, Exp2, Exp3(default)))

View solution in original post

1 Reply
CELAMBARASAN
Partner - Champion
Partner - Champion

Try this

=if($(vSelect)=1,(sum(if(Year2Date(PERIOD,0,if(MONTH(LatestDate)>11,1,MONTH(LatestDate)+1),LatestDate),$(vMeasure)))/
(sum(TOTAL(if(Year2Date(PERIOD,0,if(MONTH(LatestDate)>11,1,MONTH(LatestDate)+1),LatestDate),$(vMeasure)))))),


if($(vSelect)=2,(SUM(IF(Year2Date(PERIOD,0,1,LatestDate),$(vMeasure)))/SUM(TOTAL(IF(Year2Date(PERIOD,0,1,LatestDate),$(vMeasure)))))))

 

Nested if should be like this

= If( Condition1, Exp1 , If(Condition1, Exp2, Exp3(default)))