Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

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.
Not applicable

Problem combining Line Color and Set Analysis

I've got a Line chart that uses a Set Analysis expression such as:

sum({1<Year = {$(=Max(Year)), $(=Max(Year)-1),  $(=Max(Year)-2)}>} Sales)

What I would like is to colorcode the years so that I can re-use the same colors for the same years in other objects. If I try something like:

If (Year = 2005, red(),
If(Year = 2006, green(),
If(Year = 2007, blue(),
If (Year = 2008, yellow())


it only works if i explicitly select the three years in the fieldbox. But if I only select for example year 2007, the linechart would still show me lines for sales in three years (2007, 2006 and 2005) but since I've only explicitly selected year 2007 that's the only year that would be correctly color-coded.

Any ideas how to correctly colorcode this situation?

1 Reply
Not applicable

Problem combining Line Color and Set Analysis

Not the same data as you, but try the following syntax


if(only({1} Year=2010),rgb(255,0,0),
if(only({1} Year=2011),rgb(150,150,150),

Community Browser