Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

chriys1337
Contributor II

Color a Dimension if it matches two parameters (if match AND)

I am trying to color a dimension green if the value in this dimension is  accuring two times in another dimension.

Dim1: Validity, Dim2: Named Account

Validity, Named Account

ST, Loreal

MT, Loreal

MT, Cisco,

LT, Stabilo

I would like to color the Dim Named Account green if one account has the Validity ST AND MT.

I tried it with entering the Dimension and fill following formula in the "Text Color" Area of the Dimension "Named Account".

if(match(Validity,'ST') and match(Validity,'MT'),green())

Unfortunately this is not working, if just one first parameter if(match(Validity,'ST'), green()) it is working.

Does anybody know how to achieve this?

I have added a sample app, the single Account is now green due to the parameter match(Validity,'ST'), the question is how to do with an and-condition?

1 Solution

Accepted Solutions
MVP
MVP

Re: Color a Dimension if it matches two parameters (if match AND)

May be like this?

Capture.PNG

Expression:

=Aggr(NODISTINCT if(index(Concat(Validity),'ST') and index(Concat(Validity),'MT'),green()),[Named Account])

24 Replies
prma7799
Honored Contributor III

Re: Color a Dimension if it matches two parameters (if match AND)

Go to expression >> Background color >> if(WildMatch(Validity,'ST','MT') , green())

prma7799
Honored Contributor III

Re: Color a Dimension if it matches two parameters (if match AND)

Or you can write your own expression if(match(Validity,'ST') and match(Validity,'MT'),green())




back.png

neha_shirsath
Valued Contributor

Re: Color a Dimension if it matches two parameters (if match AND)

Use-

if(WildMatch(Validity,'ST','MT'),Green())

chriys1337
Contributor II

Re: Color a Dimension if it matches two parameters (if match AND)

I would like to color the Dimension and not the Expression.

chriys1337
Contributor II

Re: Color a Dimension if it matches two parameters (if match AND)

This statement will color all ST and all MT green.

I would just like to color those which are (ST and MT together).

chriys1337
Contributor II

Re: Color a Dimension if it matches two parameters (if match AND)

This statement will color all ST and all MT green.

I would just like to color those which are (ST and MT together).

prma7799
Honored Contributor III

Re: Color a Dimension if it matches two parameters (if match AND)

Go to dimenssion>> Background color >> if(WildMatch(Validity,'ST','MT') , green())



dime.png

stigchel
Honored Contributor

Re: Color a Dimension if it matches two parameters (if match AND)

Use concat first

=if(index(Concat(Validity),'ST') and index(Concat(Validity),'MT'),green())

neha_shirsath
Valued Contributor

Re: Color a Dimension if it matches two parameters (if match AND)

=if(Dimensionality() = 1,

colormix1(Your expression, white(), RGB(252, 85, 67)),white())

Community Browser