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: 
rodrigue_saade
Partner - Creator
Partner - Creator

Get Total of Gross Profit %

Hi,

I have the following table:

Capture.PNG

In this table, i am calculation the VP_GPM % which is the vendor gross margin (VP-GPM %) as VP-Gross Profit / Sales.

I am getting the right percentage per each ITEMID.

However, i am not getting the overall percentage (total).

Any suggestions?

nancy.sbeity

5 Replies
Gysbert_Wassenaar

What are the expressions you use to calculate Sales and VP -Gross Profit?


talk is cheap, supply exceeds demand
pamaxeed
Partner - Creator III
Partner - Creator III

You can use Column(x)/Column(y) ....it should work...

in your case I think you just have to divide Column(5)/Column(4)....

Cheers,

Patric

Anonymous
Not applicable

1 Sales  and VP-GrossProfit should be calculate values  for  example

Sum(Sales)

Sum([VP-Gross Profit])

2. if you  use  simple table,  select in tab Expression -> Total Mode

Expression Total

if you use pivot  table, select in tab Presentation -> Show Partial sum

Captura 5.JPG

nancy_sbeity
Partner - Contributor III
Partner - Contributor III

Hello Gysbert,

The expression of VP - Gross Profit :

(((Sales/Quantity)-Vendor Price)  / (Sales/Quantity))  * Quantity

The expression of the sales is sum(Sales)

Gysbert_Wassenaar

(((Sales/Quantity)-Vendor Price)  / (Sales/Quantity))  * Quantity

Ok, you're not using any explicit aggregation which means that Qlikview uses the Only() function. The only function can only (hence its name) return a value if there's only one possible value. At the total level that's not the case and thus you don't get a result at the total level. Try making the aggregation explictit: sum((((Sales/Quantity)-Vendor Price)  / (Sales/Quantity))  * Quantity)


talk is cheap, supply exceeds demand