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: 
ShaneMichelon1
Partner - Contributor III
Partner - Contributor III

Color expression for a calculated dimension in a table

Hi.  I have a table with a complex calculated dimension that used If, AGGR, and Rank.  It works fine, but I want to colour the dimension values based on a condition.

The Dimension is like this (a bit simplified):

Aggr(

If(Rank(Sum(Amounts))<=10,

  Dual(SupplierName,Rank(Sum(Amounts)) ),

  If(Rank(Sum(Amounts))<=50,

      Dual('10-50',100),

      Dual('>50',1000)

    )),SupplierName)

Note there could be errors in my sample above, but my actual much more complex dimension works.  How do I now assign colours to the three groups (top 10, single row for 10-50, single row for >50)?

I have tried setting the colour expression to something like this:

if(Column(1)='10-50', lightRed(), Blue())

But I think the column function only refers to measure columns.

Labels (2)
2 Replies
Kayleigh_Milewski
Contributor III
Contributor III

Can you do something like this?

 

if(

Aggr(

If(Rank(Sum(Amounts))<=10,

  Dual(SupplierName,Rank(Sum(Amounts)) ),

  If(Rank(Sum(Amounts))<=50,

      Dual('10-50',100),

      Dual('>50',1000)

    )),SupplierName)

= '10-50', lightRed(), Blue())



 

ShaneMichelon1
Partner - Contributor III
Partner - Contributor III
Author

Thanks.  I think I tried something like that but could not get it to work.  I'll give it another go.