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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Script Debugging help

please help debugging the script below

if (  "REPORTTYPE" = 'FP UNPAIDS GREATER THAN 2',"REPORTVALUE" * -1,

If"PLANCODE" = 1560,"REPORTVALUE" * -1,"REPORTVALUE" )) As "Sum of Mailshots",

thanks in advance

3 Replies
Anonymous
Not applicable
Author

Don't use quotes (") around your field names. That will make it a string instead of referencing the field.

Not applicable
Author

if (  REPORTTYPE = 'FP UNPAIDS GREATER THAN 2', REPORTVALUE * -1 ,

IfPLANCODE = 1560, REPORTVALUE * -1, REPORTVALUE )) As [Sum of Mailshots]

OR you can also try:

if (  REPORTTYPE = 'FP UNPAIDS GREATER THAN 2' or PLANCODE = 1560, REPORTVALUE * -1 , REPORTVALUE ) As [Sum of Mailshots]


I'm assuming REPORTTYPE, PLANCODE & REPORTVALUE are correctly spelt names and they exist in your model and that PLANCODE & REPORTVALUE are numeric.

Not applicable
Author

Hi,

I was told if i use double qoutes it works the same as square brackets and only makes it a field if i used single quotes