Skip to main content
Announcements
See why Qlik is a Leader in the 2024 Gartner® Magic Quadrant™ for Analytics & BI Platforms. Download Now
cancel
Showing results for 
Search instead for 
Did you mean: 
amit_shetty78
Creator II
Creator II

Pivot Chart - Configuring dynamic variance with formatting

 

I have a requirement where I need to do variance analysis on stages of data received.    

Dimension1Dimension2StageValue
D1D2S14320.6
D1D2S21680.41
D1D2S32386.55
D1D2S42828.67
D1D2S52828.67
D1D3S11643.43
D1D3S21643.43
D1D3S31700
D1D3S41700
D1D3S51700

 

By default there would be just 5 stages S1, S2, S3, S4 and S5.

 

So my resulting pivot chart would be:

 

   

Dimension1Dimension2S1S2S3S4S5
D1D24320.61680.412386.552828.672828.67
D1D31643.431643.43170017001700

 

 

Here the values in S2 – S5 are color coded depending on it being greater than, less than or equal to the previous value. E.g., S2 in the first row if less that S1 in the same row, hence S2 value is red.

 

If there is an increase in the value then it is orange and if it’s the same then its green.

 

I am calculating the S1-S2 values using set analysis, hence the stages are hard coded in the expressions:

 

Following is the expression I have for S2. Also have an expression on the Text color of the expression to show it as Red, Green or Orange.

 

=IF(Sum({$<Stage={'S1'}>}Value) > Sum({$<Stage={'S2'}>}Value)

 

                ,' '

 

                ,IF(Sum({$<Stage={'S1'}>}Value) < Sum({$<Stage={'S2'}>}Value)

 

                                ,' ','   '

 

                                )

 

                ) & ' ' & Sum({$<Stage={'S2'}>}Value)

 

 

Here is my difficulty, there is a possibility that sometime there may be an intermediate stage say S2-1 which should appear between S2 and S3 and variance calculated. I would like to make it dynamic and also show the conditional formatting of the values.

 

What is the best way to implement this? I can use a normal pivot with the Stage as a dimension and then transpose the dimension to show as columns. But doing this how do I also apply the formatting?

  Appreciate your help on this.

1 Solution

Accepted Solutions
antoniotiman
Master III
Master III

Hi Amit,

see attachment.

Regards,

Antonio

View solution in original post

5 Replies
sunny_talwar

Would you be able to share a sample of your intermediate application with the extra bit of difficulty you are having?

antoniotiman
Master III
Master III

Hi Amit,

see attachment.

Regards,

Antonio

sunny_talwar

Hey antoniotiman‌ -

Did you read this section in the OP?

Capture.PNG

Did not see anything that would address this? or am I missing something?

Best,

Sunny

antoniotiman
Master III
Master III

Hi Sunny,

I need new sample data.

amit_shetty78
Creator II
Creator II
Author

Thanks Antonio Mancini.

This is exactly what I was looking for.