Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

sdealtrey
New Contributor

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

1 Solution

Accepted Solutions

Re: Using Measure Variables in calculated expressions

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
2 Replies

Re: Using Measure Variables in calculated expressions

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
sdealtrey
New Contributor

Re: Using Measure Variables in calculated expressions

I was missing a set of (). Thanks!

Community Browser