Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
QlikWorld 2020: Join us May 11 - 14, 2020 in Phoenix, AZ. Register early and save $400. Learn More
scaruthers
New Contributor

Color Expression by Year (If Statements)

I am trying to create and If statement that allows me to use the color expression function to color by specific year. I have come close to a solution, but not as I'd like it to be. (color codes are just examples)


This gets me a color for the first year, and all other years get the second. Its a start.

if([Service Year] = 2017, argb(255,1,149,189), argb(255,1,179,169))

What I'd like to see is:

IF([Service Year] = 2017, argb(255,1,149,189),


IF[Service Year] = '2016', argb(255,1,179,169)),

IF([Service Year] = '2015', argb(255,40,39,171)),


Etc..

Has anyone tried something similar to this?


Thanks

Tags (1)
1 Solution

Accepted Solutions

Re: Color Expression by Year (If Statements)

Try this

Pick(Match([Service Year], 2017, 2016, 2015), ARGB(255,1,149,189), ARGB(255,1,179,169), ARGB(255,40,39,171))

View solution in original post

3 Replies

Re: Color Expression by Year (If Statements)

Try from your end and tell us how you are getting the combination of nested if statements

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)

Re: Color Expression by Year (If Statements)

Try this

Pick(Match([Service Year], 2017, 2016, 2015), ARGB(255,1,149,189), ARGB(255,1,179,169), ARGB(255,40,39,171))

View solution in original post

scaruthers
New Contributor

Re: Color Expression by Year (If Statements)

That worked!

Thank you!!