Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
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)))