Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Change color of 2nd dimension based on max value on 1st dimension

Hi -

Sample Data:

CategorySubCategoryPrice
C1S1100
C1S2200
C1S350
C2S11400
C2S12500
C2S13600
C3S21800
C3S22700

I need to represent the above data in a straight table and then change the background color of particular 'SubCategory' data-item to Yellow based on a clause.

The clause is the 'Subcategory' should have the highest price in its respective 'Category' section.

For example change the background color of S2, S13 and S21 to yellow since they have the highest price in their respective Category.

11 Replies
sunny_talwar

This will work:

=If(Aggr(sum(StandardCost), EnglishProductCategoryName, EnglishProductSubCategoryName, EnglishProductName) = max(total<EnglishProductCategoryName> Aggr(Sum(StandardCost), EnglishProductCategoryName, EnglishProductSubCategoryName, EnglishProductName)), Yellow())

Not applicable
Author

And it did work. Splendid!

Just a quick question on total<EnglishProductCategoryName>...why shall we use a dimension after Total in the above scenario?