Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
napac1458
Contributor II

Invalid expression help

Hello,

I'm receiving an invalid expression error when trying to create a flag in my script.  I'm not sure what I'm doing wrong.  Can anyone help me?

LOAD

%METRIC_KEY,

if(TARGET_VARIANCE = 'U',

if(if(MASK_DISPLAY = '#.##%', num(sum(NUMERATOR)/sum(DENOMINATOR), '#,##0.00%'),

Median(MEDIAN))<THRESHOLD_TARGET), 'Bad',

  if(if(MASK_DISPLAY = '#.##%', num(sum(NUMERATOR)/sum(DENOMINATOR), '#,##0.00%'),

Median(MEDIAN))>= sum(THRESHOLD_TARGET) and if(MASK_DISPLAY = '#.##%', num(sum(NUMERATOR)/sum(DENOMINATOR), '#,##0.00%'),

Median(MEDIAN))< if(MASK_DISPLAY = '#.##%', num(TARGET, '0.00%'),

TARGET), 'OK', 'Good')),

if(if(MASK_DISPLAY = '#.##%', num(sum(NUMERATOR)/sum(DENOMINATOR), '#,##0.00%'),

Median(MEDIAN))<TARGET, 'Good',

  if(if(MASK_DISPLAY = '#.##%', num(sum(NUMERATOR)/sum(DENOMINATOR), '#,##0.00%'),

Median(MEDIAN))<= THRESHOLD_TARGET and if(MASK_DISPLAY = '#.##%', num(sum(NUMERATOR)/sum(DENOMINATOR), '#,##0.00%'),

Median(MEDIAN))> if(MASK_DISPLAY = '#.##%', num(TARGET, '0.00%'),

TARGET), 'OK', 'Bad'))) as Flag

Resident FACT_temp

Group by %METRIC_KEY;

Thank you in advance.

1 Reply
Employee
Employee

Re: Invalid expression help

You need to have

TARGET_VARIANCE,MASK_DISPLAY at group by too, since they are not beeing aggregated at expression

Community Browser