Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Pick() expression for Pivot Chart

Hi Qlikers,


Here I've uploaded the image of my Pivot Chart along with the qvw attached herewith for your ready reference.

Pivot Chart - using PICK().jpg

Now, I'm finding difficulties when I've attempted to use Pick() for the same expression which is working fine for Current vs Previous Year Sales comparison to display for the TopN customers of currently selected FY. [The expected data chart layout should be as per the chart# 1.]

In Chart# 1, I've put the expression for TopN customers sales of currently selected FY with previous year comparison. Here, 'Sub-Total', 'Others' & 'Grand Total' expression had not set.

Expression in Chart# 1:

Sum({

       <FYear+={"$(=(max(FYear)-2) & '-' & (max(FYear) -1))"} ,

       CustomerName={'=Rank(SUM([BOIQOD]) / [TK_Amount])<= [vTopX]'}> }   

       [BOIQOD]/ [TK_Amount] )

In Chart# 2, soon I've just added Pick() for the same expression used in Chart# 1, it got messed up.

Expression in Chart# 2:

= Pick(Measure,

  Sum({

       <FYear+={"$(=(max(FYear)-2) & '-' & (max(FYear) -1))"} ,

       CustomerName={'=Rank(SUM([BOIQOD]) / [TK_Amount])<= [vTopX]'}> }   

       [BOIQOD]/ [TK_Amount] )

)

In Chart# 3, full expression for Pick() been added but result almost same.

Expression in Chart# 3:

= Pick(Measure,

  Sum({

       <FYear+={"$(=(max(FYear)-2) & '-' & (max(FYear) -1))"} ,

       CustomerName={'=Rank(SUM([BOIQOD]) / [TK_Amount])<= [vTopX]'}> }   

       [BOIQOD]/ [TK_Amount] ),

  Sum({

       <FYear+={"$(=(max(FYear)-2) & '-' & (max(FYear) -1))"} ,

       CustomerName={'=Rank(SUM([BOIQOD]) / [TK_Amount])<= [vTopX]'}> }   

       [BOIQOD]/ [TK_Amount] ),

  Sum({

       <FYear+={"$(=(max(FYear)-2) & '-' & (max(FYear) -1))"}> }   

       ([BOIQOD]/ [TK_Amount]) )

-

  Sum({

       <FYear+={"$(=(max(FYear)-2) & '-' & (max(FYear) -1))"} ,

       CustomerName={'=Rank(SUM([BOIQOD]) / [TK_Amount])<= [vTopX]'}> }   

       [BOIQOD]/ [TK_Amount] ),

    

  Sum({

       <FYear+={"$(=(max(FYear)-2) & '-' & (max(FYear) -1))"}> }   

       ([BOIQOD]/ [TK_Amount]) )

)

Would appreciate if you please look into and provide solution how I can overcome the problem for Chart# 3 and get correct set of Data as per lay-out of Chart# 1?


Thanks in Advance,

Sajjad.

1 Reply
Not applicable
Author

Hello There!

Should I need to clarify the issue further..... ? Highly appreciate your kind attention.

Thanks in Advance.

Sajjad.