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

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
krishnagutha1294
Partner - Contributor II
Partner - Contributor II

Percentage calculation

Hi all

Need to calculate Percentage for products. 

I have one field called Product in that i have valves like Apple, Banana,Grapes,Mango.

I want to calculate Percentage for each product for based on Month.

For Example Sum(Product)=10000 In that Sum(Apple)=3000,Sum(Banana)=4000,Sum(Grapes)=2000,Sum(Mango)=1000

Let assume this data belongs 6 months  now need to calculate percentage for each Product valve

Product Valve= Each Month valve/Sum(Product Valve)

Pls can any one help me how to write expression for this case.

 

Thanks in Advance

12 Replies
Vegar
MVP
MVP

Are your sum total disregarding Commodity dimension?

It looks like your first image could present the rate of a commodity based on all volume on all commodities and months and that your second picture is showing the rate of commodity based on all commodities for february 2020. With a correct expression your second picture would show 100%

I would expect that your expression looks something like this

sum( Volume)/sum(Total Volume)

When it should look like this

sum( Volume)/sum(Total <Commodity> Volume)

 

krishnagutha1294
Partner - Contributor II
Partner - Contributor II
Author

But I am using Same expression for Both pictures just only i made selection.

The expression is like below

Num(Count(BU)/Count(total <"Commodity Group">BU),'0%')

Vegar
MVP
MVP

Is [Commodity Group] the same as the [Commodity] in your pivot? If not then change it. Totaling are summing over all dimensions in your pivot table except the one listed in <>. If you want it to exclude Commodity you will need to type Commodity and not a equivalent field name such as Commodity group from your data model.