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: 
alexpanjhc
Specialist
Specialist

pie chart question

I have a table

load *

inline [

id, sales, shipping, tax, discount 

1, 100,2,5,-2

2,120,10,7.2,0

3,50,20,0,10

]

if i want to categorize: sale in to taxable, and others in notaxable.

how do I show them in a pie chart that I can drill down  the taxable and nontaxable to the lowest level or can it even  present in a table?

thanks!

1 Solution

Accepted Solutions
Quy_Nguyen
Specialist
Specialist

Try this script:

Temp:

CrossTable(TypeLv2,Value,1)

load *

inline [

id, sales, shipping, tax, discount

1, 100,2,5,-2

2,120,10,7.2,0

3,50,20,0,10

];

FinalData:

Load id,

If(TypeLv2 = 'sales', 'Taxable','Notaxable') as TypeLv1,

    TypeLv2,

    Value

Resident Temp;

Drop Table Temp;

Then create a drill-down dimension in your master items.

Capture.PNG

Create a pie chart:

+ Dimension: Your drilldown dimension

+ Measure: Sum(Value)

View solution in original post

1 Reply
Quy_Nguyen
Specialist
Specialist

Try this script:

Temp:

CrossTable(TypeLv2,Value,1)

load *

inline [

id, sales, shipping, tax, discount

1, 100,2,5,-2

2,120,10,7.2,0

3,50,20,0,10

];

FinalData:

Load id,

If(TypeLv2 = 'sales', 'Taxable','Notaxable') as TypeLv1,

    TypeLv2,

    Value

Resident Temp;

Drop Table Temp;

Then create a drill-down dimension in your master items.

Capture.PNG

Create a pie chart:

+ Dimension: Your drilldown dimension

+ Measure: Sum(Value)