Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
QlikWorld online is next week! REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
mariovella
Contributor II
Contributor II

Sum as a % of dimension

Can anyone kindly help me?

I have two dimensions (Region, city) and a measure (sale). Here the values

  

RegionCity Sales
LombardyMilan 127.391,33
LombardyMilan 119.348,40
LazioRoma   18.511,46
TuscanyFlorence   87.786,00
TuscanySiena   55.312,22
TuscanyFlorence 200.691,51
LombardyPavia   68.262,00

How can I manage the set analysis in order to have the sales in Milan as a percentage of the sales in Lombardy ?

The result is (127.391,33+119.348,40)/(127.391,33+119.348,40+68.262,00).... but I don't know what to do in  a set analysis.

Thanks for any help

Mario

1 Solution

Accepted Solutions
sunny_talwar

May be this

Sum(Sales)/Sum(TOTAL <Region> Sales)

View solution in original post

6 Replies
sunny_talwar

May be this

Sum(Sales)/Sum(TOTAL <Region> Sales)

campbellr
Creator
Creator

Hi Mario

The set analysis to get sales for milan as a percentage of sales lombardy:

Sum({<City={'Milan'}>} Sales) / Sum({<Region={'Lombardy'}>} Sales)

Ron

if you want it to be based on selection then it can get a little trickier

mariovella
Contributor II
Contributor II
Author

Ron,

thanks a lot for your help.

As you said, I'm actually looking for a formula  based on selection.

Can you help me ?

THANKS

sunny_talwar

I'm actually looking for a formula  based on selection.

Can you elaborate a little on this?

mariovella
Contributor II
Contributor II
Author

Great!! Thanks a lot Sunny. A great help for me

campbellr
Creator
Creator

you can try this, similar to what Sunny suggested.
Sum(total <city> Sales) / Sum(total <Region> Sales)