Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
kvr9
Creator
Creator

Pie chart percentage calculation

Hi ,

I'm looking for a pie chart calculation.

I want to display company name along with Sales Percentage and Sales with a data restriction.

My table contains below coulmns:

Company,Sales,Year,Product

A     ,109,2015,aa

B     ,106,2015,aa

C     ,103,2015,aa

D     ,110,2015,aa

A     ,105,2016,bb

B     ,107,2016,bb

C     ,104,2016,bb

D     ,101,2016,bb


I want to restrict my data by company(A,B,C) and product(aa), Could you someone help to calculate the pie chart percentage with above conditions.

Please find the sample data my qvw.

6 Replies
devarasu07
Master II
Master II

Hi,

Try like this

Method 1:

Fact:

LOAD Company,

     Sales,

     Product,

     Year

FROM

(ooxml, embedded labels, table is Sheet1) where  Match(Company,'A','B','C') and Product='aa';


Chart: measure expression as

Sales %

sum(Sales)/sum(TOTAL Sales)


Method 2:

using set analysis method at chart - Sales % expression

sum({<Company={'A','B','C'},Product ={'aa'}>}Sales)/sum(Total {<Company={'A','B','C'},Product ={'aa'}>} Sales)

Capture.JPG

kvr9
Creator
Creator
Author

Thank you Devarasu.

It works.

devarasu07
Master II
Master II

Hi,

Np. Can you close this thread by marking correct. it might useful for other who is having similar issue. Thanks

Regards,

Deva

kvr9
Creator
Creator
Author

Could you please tell me how to close the tread,as I'm new to this community

akpofureenughwu
Creator III
Creator III

Hello VijAYA. Beneath the  comment made by Devarasu, you will see the action tab, click on it, you will see various option, click on correct answer and you are there

Regards   

devarasu07
Master II
Master II

Hi,

Go to my 1st report with solution section then u can see like below screen mark as answered.

Capture.JPG

More check this,

Qlik Community Tip: Marking Replies as Correct or Helpful