Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
soha1902
Creator
Creator

How to compare Pivoted Dimension??

Hi All,

I am Pivoting one dimension in Pivot table. For Example Dimension Name is:  Custom_Value and it is having four fields like Value1, Value2, Value3 and Value4. So My pivot table looks like below:

OtherDimensionValue1Value2Value3Value4
D1V1V1V3V4
D2V11V21V31V41
V22V22V32V42

Now I need to compare Value1 and Value2. If Value1 is equal to value2 then value2 cells turn green.

For this I expanded Custom_Value Dimension and under Background I wrote below expression:

     IF(Custom_Value = 'Value1', (if('Value1' = 'Value2', Green()))

But it not working. And also If I write

    IF(Custom_Value = 'Value1', Green()) then only header  turns green.

Please help me to find this solution.

1 Solution

Accepted Solutions
Not applicable

try this

=If(CUSTOM_FIELD_NAME = 'IP Version Tag',IF(after(trim(cus_value),21)=trim(cus_value),Green()))

Regards,

Chinni Kanna

View solution in original post

9 Replies
Not applicable

Try this

if(Custom_Value = 'Value1',(if(sum(SalesPrice)= sum({$<Custom_Value = {'Value2'}>}SalesPrice) ,rgb(179,179,179))))

Replace Sum(SalesPrice) with your expression for V1

Regards,

Chinni Kanna

soha1902
Creator
Creator
Author

Thanks for your reply Chinni but still only header name turns green.

Cell values are still default color..

tresesco
MVP
MVP

See the attached sample if it helps. Try expression background color.

soha1902
Creator
Creator
Author

Thanks tresesco..

But please let me know any dynamic way where I can compare every column to other column.

For example If I am having D1,D2,D3,D4 and D5 and now want to compare D1 to D4. Then how I'll do this???

Please let me know...

tresesco
MVP
MVP

See my expression. Before() could be used dynamically. If any doubt, share your sample qvw.

Not applicable

It should work, if not send me test file

Regards,

Chinni Kanna

soha1902
Creator
Creator
Author

You wrote

(Before(Sum(Amt))=Sum(Amt),Green())

But Please plz tell me if I want to compare Is D1 is equal to D3 if yes then D1 turns green.

Plz help me ......

tresesco
MVP
MVP

Then, try:  If(After(Sum(Amt),2)=Sum(Amt),Green())

Not applicable

try this

=If(CUSTOM_FIELD_NAME = 'IP Version Tag',IF(after(trim(cus_value),21)=trim(cus_value),Green()))

Regards,

Chinni Kanna