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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
tresB
Champion III
Champion III

How to store calculated single dimension value in a variable

Hi All,

i am using the following formula in a gauge chart to show the MTD growth(can't use direct InMonthTodate, because there is a different calendar used in the date field.)

=if(KOMONTH=vCurr_KOMONTH,aggr((Sum({<YEAR=,KOMONTH=,DAY=>} InYearToDate(BILL_DATE,'$(MaxDate)',0,1) * -1 * CCIQUANTITY*CCIUNIT_CASE) - Sum({<YEAR=,KOMONTH=,DAY=>} InYearToDate(BILL_DATE,'$(MaxDate)',-1,1) * -1 * CCIQUANTITY*CCIUNIT_CASE)) / (Sum({<YEAR=,KOMONTH=,DAY=>} InYearToDate(BILL_DATE,'$(MaxDate)',-1,1) * -1 * CCIQUANTITY*CCIUNIT_CASE)),KOMONTH)) .

This gives true value in a list box. But no value in a Textbox or in the GAUGE chart. i suspect this is because of dimension(use AGGR function).

OR simply guide me HOW CAN I STORE THIS(result) in a VARIABLE.

Anybody with a solution thought is appreciated.

With regards,

tresesco



Labels (1)
1 Reply
tresB
Champion III
Champion III
Author

Hey............I have got the solution!!!

The IF was the culprit. I simply replaced the if with Set analysis accordingly.....and then i was done.

enjoy QV!