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: 
Not applicable

set analysis(using an if statement)

Hi,

Can some1 help me on this, my if statement seems to not be working

(Sum( {$<ScriptMonth={$(=concat('"' & CurrYearMonth & '"', ',' ))}>} if(vMeasures = 'SepPack','(Qty * SepPack)',$(vMeasures))))

if the measure is = 'SepPack' then the calculation is not correct

Thanks in Advance

Labels (1)
1 Solution

Accepted Solutions
swuehl
Champion III
Champion III

Remove the single quotes around your THEN branch:

Sum(

{$<ScriptMonth={$(=concat('"' & CurrYearMonth & '"', ',' ))}>}

     if(vMeasures = 'SepPack',

          (Qty * SepPack)                // removed single quotes here, you want the fields, not a literal

          ,$(vMeasures)    

     )

)

View solution in original post

4 Replies
alexandros17
Partner - Champion III
Partner - Champion III

Try with the $ expansion:

(Sum( {$<ScriptMonth={$(=concat('"' & CurrYearMonth & '"', ',' ))}>} if($(vMeasures) = 'SepPack','(Qty * SepPack)',$(vMeasures))))


let me know

Not applicable
Author

I tried with that but it still doesnt work

swuehl
Champion III
Champion III

Remove the single quotes around your THEN branch:

Sum(

{$<ScriptMonth={$(=concat('"' & CurrYearMonth & '"', ',' ))}>}

     if(vMeasures = 'SepPack',

          (Qty * SepPack)                // removed single quotes here, you want the fields, not a literal

          ,$(vMeasures)    

     )

)

Not applicable
Author

Hi,

I removed single quotes  and its working, thanks