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

Announcements
Learn how to migrate to Qlik Cloud Analytics™: On-Demand Briefing!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Pie Chart Based on Columns

I have a source data like this:

RUN_IDCLIENTBRR_SerialNoBRR_StatusBRR_RetireDateBRR_City
2MY2101
2MY21210

And I want a Pie Chart like this when I click the Client MY:

pie.jpg

The problem is that I want to base myself on columns instead of rows. Should I make a table transformation first? If yes, how?

Thanks,

Miguel

1 Solution

Accepted Solutions
Not applicable
Author

Done it!!!!!

PrePie:

Load @3 as Client,

  @7 AS BRR_SerialNo,

     @8 AS BRR_Status,

     @9 AS BRR_RetireDate,

     @10 AS BRR_City

FROM

[..\Data\foo.tabdel]

(txt, codepage is 1252, NO labels, delimiter is '\t', msq)

store PrePie into ..\QVD\~PrePie.qvd;

Pie:

CrossTable(Reason, Percentage)

LOAD Client,

     BRR_SerialNo,

     BRR_Status,

     BRR_RetireDate,

     BRR_City

FROM

[..\QVD\~PrePie.qvd]

(qvd);

View solution in original post

4 Replies
Not applicable
Author

I think I'm on the way.

What I did was enabling the transformation step when building the script and transposed the table.

Not applicable
Author

I'm not sure if I really have to rotate the table.

Because I can have infinite clients, and then I need to have a listbox to select the client and auto update the pie chart.

So I don't know how to do this with rotating the table because I can have a non determined number of columns...

Not applicable
Author

Any idea? Maybe if I change the source file first using some developer skills?

Not applicable
Author

Done it!!!!!

PrePie:

Load @3 as Client,

  @7 AS BRR_SerialNo,

     @8 AS BRR_Status,

     @9 AS BRR_RetireDate,

     @10 AS BRR_City

FROM

[..\Data\foo.tabdel]

(txt, codepage is 1252, NO labels, delimiter is '\t', msq)

store PrePie into ..\QVD\~PrePie.qvd;

Pie:

CrossTable(Reason, Percentage)

LOAD Client,

     BRR_SerialNo,

     BRR_Status,

     BRR_RetireDate,

     BRR_City

FROM

[..\QVD\~PrePie.qvd]

(qvd);