Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
azmeerrehan
Partner - Creator
Partner - Creator

Bar Chart If Statement Issue

I have a BAr chart without any dimensions. I am trying to evaluate the below if condition but the result bar I am getting is ignoring the if statement.  How can I accomplish this Iff statement in my Bar chat.  This statement works fine in a straight table cuz its evaluating it for each row.

If(

Sum({<Date = {"$(vMaxSupply)"} >} current_supply_and_shipped)

>

SUm({<Date = {"$(vMaxSupply)"} >} Net_Planned_Units),

sum({<Date = {"$(vMaxSupply)"}>} current_supply_and_shipped)

-

sum({<Date = {"$(vMaxSupply)"} >} Net_Planned_Units),

0)

2 Replies
settu_periasamy
Master III
Master III

Hi Rehan,

is that expression working in Straight table without dimension? then i think it will work for Bar chart also.

Maybe try like. (Check the vMaxsupply variable having the Proper value)

Sum({<Date = {"$(vMaxSupply)"} >}

     if ( current_supply_and_shipped > Net_Planned_Units ,

           current_supply_and_shipped - Net_Planned_Units),0)

sunny_talwar

What is the dimension when you view this in a straight table? May be you need this

Sum(Aggr(

If(

Sum({<Date = {"$(vMaxSupply)"} >} current_supply_and_shipped)

>

Sum({<Date = {"$(vMaxSupply)"} >} Net_Planned_Units),


Sum({<Date = {"$(vMaxSupply)"}>} current_supply_and_shipped)

-

Sum({<Date = {"$(vMaxSupply)"} >} Net_Planned_Units),

0)

,StraightTableDimension))