Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
LINKEDIN LIVE: Democratizing data to enhance customer-centricity. JULY 29TH REGISTER TODAY
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

1 Solution

Accepted Solutions
swuehl
MVP
MVP

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

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
MVP
MVP

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

Not applicable
Author

Hi,

I removed single quotes  and its working, thanks