Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to calculate a ratio

Hello everybody,  new using qlikview i cant find solution to my problem:

here a little description:

i have the follow cross table in Qlikview and i need to calculate column 5 (Ratio Sales / Chimical Activity Sales).

Country1CitySalesChimical Activity SalesRatio Sales / Chimical Activity Sales
IrlandDublin10080100/980
JapanTokio200100200/980
Osaka450400450/980
USANY300100300/980
Boston500300500/980
TOTAL1 5509801550/980

i was trying to use TOTAL fonction but is not working

Sum([Sales / sum(TOTAL  Chimical Activity Sales]

how could i do to fixe the denominator "980" ?...

Thanks

13 Replies
miguelbraga
Partner - Specialist III
Partner - Specialist III

Hi Teddy,

I think your expression is wrong:

What you have:

Sum([Sales / Sum (TOTAL Chimical Activity Sales]

What you should have:

Sum([Sales]) / Sum ([Chimical Activity Sales])


Enable totals in Country 1 and this should do the trick

Regards,

MB

Anonymous
Not applicable
Author

if Chimical Activity Sales is fixed like 980

then you can try:

Sum([Sales])/980 in expression For Ratio


Then in number format you can set this expression with Ticked Show in % with 2 decimal

Anonymous
Not applicable
Author

Also you can defined a variable with:

Ctrl+Alt+V

like VChemicalSales=980

then

Expression:  sum(Sales)/$(VChemicalSales)

Hope this will help!!

Kushal_Chawda

try,

sum(Sales)/ Sum( Total [Chimical Activity Sales])

sauliusr
Contributor II
Contributor II

You expression should be:

Sum([Sales]) / Sum (TOTAL [Chimical Activity Sales])

Not applicable
Author

Hi thanks but in my cross table

When I’m trying Sum([Sales]) / Sum ([Chimical Activity Sales])

or

Sum([Sales]) / Sum (TOTAL [Chimical Activity Sales])

He is giving to me for the first row (100/80), second row (200/100) and so on,

but the ratio that I need is 100/980 for the first row, 200/980 for second and so on.

In my exemple 980 is a calculated value is not fixed amount, is the total of column “Chimical Activity Sales”

Regards

Tedtris.

Not applicable
Author

Hi thanks but in my cross table

980 is a calculated value is not fixed amount, is the total of column “Chimical Activity Sales”

Regards

Tedtris.

Not applicable
Author

Hi thanks but  in my exemple 980 is a calculated value is not fixed amount, is the total of column “Chimical Activity Sales”.

Regards

Teddy

Not applicable
Author

Hi thanks but  in my exemple 980 is a calculated value is not fixed amount, is the total of column “Chimical Activity Sales”.

Regards

Tetris