# Qlik Sense on AWS & Azure

Discussion board where members can learn more about Qlik Sense deployments on Public Cloud Infrastructures such as AWS and Azure.

Highlighted
Contributor II

## Reference to the measure itself in the formula (without IF)

Hi,

Let's say I want to calculate a measure SUM( Sales ), but I want to show only the numbers above certain threshold (the others should return Null).

I can do it using if:

if( SUM (Sales) < 100, SUM (Sales), Null() )

Is there way to do the same without using IF, like using Set Analysis?

Smth like: SUM (   {< SUM(Sales)<{100} >}    [Sales] )

Thank you!

Tags (3)
1 Solution

Accepted Solutions
Not applicable

## Re: Reference to the measure itself in the formula (without IF)

Hi,

the equivalent would be

sum({\$<sales={"<50"}>}sales)

I cannot take all the credit here i read this guide which i found really helpfull

A Primer on Set Analysis

5 Replies
Contributor

## Re: Reference to the measure itself in the formula (without IF)

Hi Aitov

Try This

sum({<Sales={">=0<100"}>}Sales)

Not applicable

## Re: Reference to the measure itself in the formula (without IF)

Hi,

the equivalent would be

sum({\$<sales={"<50"}>}sales)

I cannot take all the credit here i read this guide which i found really helpfull

A Primer on Set Analysis

Contributor

## Re: Reference to the measure itself in the formula (without IF)

Dear Aitov

For that u need to take the Sum(Sale) field from back end using Aggr() function.

Not applicable

## Re: Reference to the measure itself in the formula (without IF)

replace the 50 with 100 little typo there

Contributor

## Re: Reference to the measure itself in the formula (without IF)

Personally I consider this feature one of the most missing one in QS, that would be very useful in lot of situations, like this:

Now (if you don't want to create a master measure expression, of course) you have to copy and paste measure definition in those functions definitions, maybe multiple times for complex ones, when you would just have a kind of "self-reference" to measure itself. E.g: if(this()<100,"do this 1",if(this()<200,"do this 2",if(this()<300,"do this 3","do that")))

Moreover above example shows the other most missing feature of QS, for me: the switch() statement (furthermore known as "case"), e.g.:

case this()

when <100 then,"do this 1"

when <200 then "do this 2"

when <300 then "do this 3"

else "do that"

end