Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Ignorer a field in an expression

Hi.

I have an object histogramme (stacked) with years in X axes (2012, 2013, 2014, etc...) and Euros in Y axes.

The expression is sum of costs for différents categories (Code IPD):

=num(sum({<AnnéeDépense = >} Dépense),'# ##0 €')

I have also a different colour defined for each category like this (in background colours expression):

=if([Code IPD] like 'A*', RGB(102,178,255),

if([Code IPD] like 'C*', RGB(255,102,102),

if([Code IPD] like 'D*', RGB(51,102,0),

if([Code IPD] like 'E*', RGB(153,0,76),

if([Code IPD] like 'F*', RGB(140,122,160),

Blue())))))

The graphic is connected with another objects, and when i click in one year it shows me détails in the other objects.

However, when i click in one year, it shows me the details of that year with correct colours, but for all other years, it shows all Blue.

How can i ignore the Year fied, to show me the correct colours for every years?

I don't know, but a way to ignore the field Year in colours conditions?

Thank you,

Carla

3 Replies
sunny_talwar

Try this:

=if(Only({1}[Code IPD]) like 'A*', RGB(102,178,255),

  if(Only({1}[Code IPD]) like 'C*', RGB(255,102,102),

  if(Only({1}[Code IPD]) like 'D*', RGB(51,102,0),

  if(Only({1}[Code IPD]) like 'E*', RGB(153,0,76),

  if(Only({1}[Code IPD]) like 'F*', RGB(140,122,160), Blue())))))


UPDATE: For Just ignoring year, you can do this:


=if(Only({<Year>}[Code IPD]) like 'A*', RGB(102,178,255),

  if(Only({<Year>}[Code IPD]) like 'C*', RGB(255,102,102),

  if(Only({<Year>}[Code IPD]) like 'D*', RGB(51,102,0),

  if(Only({<Year>}[Code IPD]) like 'E*', RGB(153,0,76),

  if(Only({<Year>}[Code IPD]) like 'F*', RGB(140,122,160), Blue())))))

Peter_Cammaert
Partner - Champion III
Partner - Champion III

Omit the set analysis specification in your expression and try again.

Not applicable
Author

It works Sunnt T!

I used the seconde option!

Thank you a lot!