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: 
Anonymous
Not applicable

Using Measure Variables in calculated expressions

Hi, I created some measure variables and want to complete some calculations.

The two in this example are mocccupancyexp_june & mdirectsalesjune.

At first I tried just dividing them (column 1), but realized it was incorrect. Columns 2 & 3 are the correct value & column 4 is a division of the two for the right percentage.

I was using =$(moccupancyexp_june) / $(mdirectsalesjune) for the initial calculation, but I must have made a mistake.  The image below has my calculations in the column header. Thanks for any help

Screen Shot 2018-02-10 at 6.51.42 AM.png

Labels (1)
1 Solution

Accepted Solutions
Gysbert_Wassenaar

Well, suppose mocccupancyexp_june is sum(DirectSales)+1 and mdirectsalesjune is sum(Amount). Then $(moccupancyexp_june) / $(mdirectsalesjune) would become sum(DirectSales)+1/sum(Amount). And that's completely different from (sum(DirectSales)+1) / sum(Amount). Just an example of what could go wrong. Since I don't know what expressions your variables really contain there's no telling what really is going wrong.


talk is cheap, supply exceeds demand

View solution in original post

2 Replies
Gysbert_Wassenaar

Well, suppose mocccupancyexp_june is sum(DirectSales)+1 and mdirectsalesjune is sum(Amount). Then $(moccupancyexp_june) / $(mdirectsalesjune) would become sum(DirectSales)+1/sum(Amount). And that's completely different from (sum(DirectSales)+1) / sum(Amount). Just an example of what could go wrong. Since I don't know what expressions your variables really contain there's no telling what really is going wrong.


talk is cheap, supply exceeds demand
Anonymous
Not applicable
Author

I was missing a set of (). Thanks!