Qlik Community

Ask a Question

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Qlik Insider - Maximize your investment, Join this webinar, May 26th. Register Today
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

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

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