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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
PeteCPEEvolution
Contributor II
Contributor II

error in expression ')'

Hi

I want to set an expression for one (or maybe eventually several) of the dimensions that make up my drill down group, such that if I make multiple charts the colouring remains consistent. In this case I want to make my different grants within "Grant report. Grant Name" have a specific set of colours.

However I keep getting.... error in expression ')' expected.

My expression is below. I actually copied this from another example where someone was discussing how they had set their colouring and theirs seemed to be working.

=if (Grant report.Grant Name="xxx",RGB (234,147,90))

Just to add I don't have any coding experience and the colour coding is arbitrary at the moment. Although is there also another way to set this more easily?

5 Replies
martinpohl
Partner - Master
Partner - Master

Hi,

change

Grant report.Grant Name="xxx" into Grant report.Grant Name='xxx' (single quotes)

Regards

sunny_talwar

Try this may be

=If([Grant report.Grant Name] = 'xxx', RGB(234,147,90))

Added square brackets around Grant report.Grant Name field. And changed the double quotes to single quotes around xxx 

PeteCPEEvolution
Contributor II
Contributor II
Author

Thanks that seems to work. I actually did have the single quotation marks before and it still hadn't worked but the square brackets seem to do the job 🙂

So if I now want to do this for all the grants, what else do I need to consider?

=If([Grant report.Grant Name] = 'aaa', RGB(000,000,153))
=If([Grant report.Grant Name] = 'bbb', RGB(000,000,153))
=If([Grant report.Grant Name] = 'ccc', RGB(000,204,102))
=If([Grant report.Grant Name] = 'ddd', RGB(000,153,076))
=If([Grant report.Grant Name] = 'eee', RGB(255,153,153))
=If([Grant report.Grant Name] = 'fff', RGB(255,102,102))
=If([Grant report.Grant Name] = 'ggg', RGB(255,051,051))

 

 

sunny_talwar

If this is a single expression... then try this

=If([Grant report.Grant Name] = 'aaa', RGB(000,000,153),
 If([Grant report.Grant Name] = 'bbb', RGB(000,000,153),
 If([Grant report.Grant Name] = 'ccc', RGB(000,204,102),
 If([Grant report.Grant Name] = 'ddd', RGB(000,153,076),
 If([Grant report.Grant Name] = 'eee', RGB(255,153,153),
 If([Grant report.Grant Name] = 'fff', RGB(255,102,102),
 If([Grant report.Grant Name] = 'ggg', RGB(255,051,051))))))))

or you can do this

=Pick(Match([Grant report.Grant Name], 'aaa', 'bbb', 'ccc', 'ddd', 'eee', 'fff', 'ggg'),
 RGB(000,000,153),
 RGB(000,000,153),
 RGB(000,204,102),
 RGB(000,153,076),
 RGB(255,153,153),
 RGB(255,102,102),
 RGB(255,051,051))

 

PeteCPEEvolution
Contributor II
Contributor II
Author

Thats really helpful, thanks.