Skip to main content
Announcements
YOUR OPINION MATTERS! Please take the Qlik Experience survey you received via email. Survey ends June 14.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to create a pie chart on selecting a name from a list box, using multiple table columns?

Hi. I'm totally new to Qlikview so forgive me if this is a noob question.

I have a csv file which contains various columns, such as UserName, Parameter1,Parameter2, etc. I successfully import the table file and create a list box with the usernames. What I want to do is, if I click on one user, then there should be a pie chart that shows the percentage breakup of that particular user's data in the columns Parameter1, Parameter2, and so on.

I tried making a pie chart on my own but I could only manage to choose a single column for representation (such as Parameter1, say), and then the pie chart would be created for the entire list of users. If I click on one user, then the pie chart changes to just one big circle color coded to that user.

i'll give an example. One column is a list of names. Second column will be "Thriller" and will contain the number of thriller movies a person owns. Next will be "Drama", "RomCom" and so on. Now, if I click on a name from the list box of names, the output needs to be a pie chart depicting that person's movie collection breakup, like 10% thrillers, 50% drama and so on..
Thanks in advance

1 Solution

Accepted Solutions
Digvijay_Singh

Try this - (I copied your data in excel sheet, attaching QVW also.)

Data:

CrossTable(AssetName, Value)

LOAD Name2,

    HoldingAssets,

    NationalSavings,

    [Premium Bonds],

    UnitTrusts,

    PersonalEquityPlans,

    Shares,

    OtherInvestments

FROM

prob174522.xlsx

(ooxml, embedded labels, table is Sheet1);

View solution in original post

7 Replies
awhitfield
Partner - Champion
Partner - Champion

Hi,

I may be easy t help if you could upload an example of your data.

Andy

Not applicable
Author

Hi Andy.

UName2HoldingAssetsNationalSavingsPremiumBondsUnitTrustsPersonalEquityPlansSharesOtherInvestments
mr4li25.807179.41296327.1111616.0788518.9662521.3626927.38469
anna_af34.1058712.5265335.6524921.6412925.4758729.5457334.7748
howe_b38.4508914.2303240.5427924.3174128.7542732.7068640.01242

That's an example of how my data looks like. I want the UName2 field to be available on the list box, and once I click on any user name, I want to be able to have a pie chart that shows the percentage breakdown of that user's Holding Assets, National Savings, Premium Bonds, Unit Trusts, Personal Equity Plans, Shares and Other Investments.

Achyuth

Digvijay_Singh

Try this - (I copied your data in excel sheet, attaching QVW also.)

Data:

CrossTable(AssetName, Value)

LOAD Name2,

    HoldingAssets,

    NationalSavings,

    [Premium Bonds],

    UnitTrusts,

    PersonalEquityPlans,

    Shares,

    OtherInvestments

FROM

prob174522.xlsx

(ooxml, embedded labels, table is Sheet1);

Not applicable
Author

I'm getting an output, but the percentages all add up to much more the 100%...
Btw, how did you manage to do this? 😮

Not applicable
Author

Is it a problem with the data itself? That the percentages are coming so awkwardly?

Btw, I'm so excited that I'm seeing the output I wanted. Spent a good week trying to figure this out. Even tried to make a darn extension and failed. Thank you!

Digvijay_Singh

Sorry, My fault. Please change the expression to  - Sum(Value)/Sum(Total Value).

I understood your data having cross table format, Qlik helps us to convert it in the form it can be evaluated as we want.

Can you mark it correct, if it solves the purpose. Thanks.

Not applicable
Author

It worked.

Thanks a million, Digvijay