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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
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

If so, then only change the variable given by Balraj to this:

Sum (TOTAL [Chimical Activity Sales])

This way you get what I require

miguelbraga
Partner - Specialist III
Partner - Specialist III

Hey Teddy,

What is your expected results? Maybe then we can help you

Regards,

MB

Kushal_Chawda

Create Variable on front end

vTotalSales = sum(aggr(sum([Chimical Activity Sales]),Country1,City))

Now write expression

=sum(Sales) / $(vTotalSales)

Not applicable
Author

Hi Kush i think that using aggr is a good idea but i dont know how to use the syntax, is not working.

in attached file you will find the qvw file

many thanks

Tetris