Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
hariprasad_koya
Contributor III
Contributor III

Segments comparison in pivot table or straight table

Dear Team,

i have a Straight table with the BU,Division,PG,Segment and the total orders available.In the last column i should display with following conditions by comparing Division,BU,PG

1.If the Segment for the current month and the segment for the last month are same then text should be displayed as 'No Change'

2.If the Segment for the current month and the segment for the last month are not same then then text should be displayed as 'Changed from that particular segment in the previous month' For eg : In the previous month the segment is Segment 1 and in the current month the segment is Segment 2 then the text should be displayed as 'Changed from Segment1 '

Please find the attached QVW and help me out in resolving this.

Thanks

Hari

4 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Maybe like this:

if(Only({<Month={'Jan'}>}Segment)<>Only({<Month={'Feb'}>}Segment),If(len(Only({<Month={'Jan'}>}Segment)), 'Change From '& Only({<Month={'Jan'}>}Segment))))


talk is cheap, supply exceeds demand
hariprasad_koya
Contributor III
Contributor III
Author

Sorry Gysbert...this is not working....Can anyone pls help me out regarding the below query.

i have a Straight table with the BU,Division,PG,Segment and the total orders available.In the last column i should display with following conditions by comparing Division,BU,PG

1.If the Segment for the current month and the segment for the last month are same then text should be displayed as 'No Change'

2.If the Segment for the current month and the segment for the last month are not same then then text should be displayed as 'Changed from that particular segment in the previous month' For eg : In the previous month the segment is Segment 1 and in the current month the segment is Segment 2 then the text should be displayed as'Changed from Segment1 '

Please find the attached QVW and help me out in resolving this.

Thanks

Hari

fonmarcelo
Contributor III
Contributor III

Hello!

Try it.

Add a calculated dimension with:

=Aggr(DISTINCT

  If(Only({<Month={'Feb'}>} Segment) = Only({<Month={'Jan'}>} Segment),'No Change','Change from ' & Only({<Month={'Jan'}>} Segment)

  ),PG

)

Segment.PNG

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

I've seen your qlikview document and it doesn't tell me exactly what you want. Can you post an example of the result table you expect?


talk is cheap, supply exceeds demand