Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

What Data format is needed to get correct percent values in Pivot table chart.

Hi,

I have used this below given formula to calculate the percent and added the field as expression in pivot table.

margin/Freight *100 as GM%

So, the calculation is correct for some values only.

The format used is integer and expression is sum(GM%).

PFA screenshot of my pivot where I've marked the wrong values in red and right ones in green.

Thanks

11 Replies
Anil_Babu_Samineni

Are you calculating like this?

margin / (Freight * 100) ???

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Anonymous
Not applicable
Author

No, (margin/freight) * 100.

techvarun
Specialist II
Specialist II

Use margin/Freight in the expression and format the field like below

sample.PNG

Anil_Babu_Samineni

So, you can play with number format or else please post QVW to test

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Anonymous
Not applicable
Author

I want to divide with the value in the freight column so count(freight) work right?

techvarun
Specialist II
Specialist II

Yeah, It will work

jonathandienst
Partner - Champion III
Partner - Champion III

Using "naked" fields in the front end can lead to unexpected results. Fields in front end expressions should normally be inside an aggregation function of some kind. Perhaps

     Sum(margin) / Sum(Freight)

     or

     Sum(margin / Freight)

Use Aggregation Functions!

And then use % format to display the values as a $

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Anonymous
Not applicable
Author

Tried this, but values r same as that in the screenshot.

techvarun
Specialist II
Specialist II

Share  sample data to work