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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

how to make an expression

Hi,

  Everyone,I have a problem about making a chart like below,

Comments:

Levels:A、B、C            (with the sales data)

So, how to write the expression with a chart in the Sample?

Best Regards!

11 Replies
Anil_Babu_Samineni

From Your Example, What are you expecting?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Not applicable
Author

thanks for your reply , perhanps it's a dynamic dimension case.   It will help a lot if you make it out.

Digvijay_Singh

The representation is bit confusing, can you try mapping all of your example values in your representation.

For example, ID001, Year 2014, Sales=4, you didn't show it in pic. If you can map your 6 example values in expected output, I think I can make equivalent in pivot table.

trdandamudi
Master II
Master II

Your sales numbers are not tagged in the source data. But I just assumed and mapped it to you source data. So take a look and see if this helps:

Picot_Chart_Part_II.jpg

Not applicable
Author

thanks for reply, I 'm sorry for confusing you, please see the question above, I have modified it.

Not applicable
Author

thanks for your reply, the field "Level" in your reply is not suspected to exist, for it's dynamic with other fields selecting

Digvijay_Singh

May be I am missing something but all I am asking is you have 3 values for 2014 and 3 values for 2015. Since you are showing 2014 and 2015 values separately, vertical(2015 values as rows) and horizontal(2014 values as columns), all I want to see 6 values in expected output.

Digvijay_Singh

all values must falls into one of the 3 conditions so we should see 6 1's corresponding to 6 values.

trdandamudi
Master II
Master II

I made the change to reflect the 'Level' in the code:

t:

Load *,

IF(Sales<=5,'A',If(Sales >5 and Sales <=10,'B',If(Sales >10,'C'))) as Level;

LOAD * INLINE [

    ID, Year, Sales

    ID001, 2014,4

    ID002, 2014,8

    ID003, 2014,12

    ID001, 2015,7

    ID002, 2015,11

    ID003, 2015,4

];

QUALIFY *;

UNQUALIFY ID;

t1:

LOAD *

Resident t;