Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

script error

Hi,

Can anyone advise how this script can be corrected:

=Sum(Enforcement)='COMPLIANCE''#0000FF'

=
Sum(Enforcement)='ENFORCEMENT''#000000'

This first sentence works fine on its own; however, add the second and it says 'Garbage after expression "-"'

Any help would be appreciated

Chris

3 Replies
Not applicable
Author

why have u written script like this?

is it expression?

Where did u write the expression?

Not applicable
Author

Is it the 'colour expression' within our Map properties....we want to colour the results by either ENFORCEMENT or COMPLIANCE.

Cheers

Chris

er_mohit
Master II
Master II

try this

sum(if(wildmatch(Enforcement,'COMPLIANCE''#0000FF','ENFORCEMENT''#000000'),Enforcement))

or

sum(if(Enforcement='COMPLIANCE''#0000FF' or Enforcement='ENFORCEMENT''#000000',Enforcement))