Qlik Community

Qlik Sense App Development

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

mwallman
Contributor

How to set a default measure when Variable is blank?

Hello all,

I am using thr QSVariable from Qlik Branch: http://branch.qlik.com/#!/project/56728f52d1e497241ae697f8

The variable is called vButton.

I have two buttons based on the above variable:

Sales

Orders

I have the following expression in Measure:

If($(vButton)='Sales',

Sum(Sales),

If($(vButton)='Orders',

Count(distinct OrderID)

)

)

It works.

However I want to show Sum(Sales) when nothing is selected in the above buttons.

How can I get the expression to work so that if the variable has nothing then it shows Sum(Sales) values?

1 Reply

Re: How to set a default measure when Variable is blank?

Change code to below.

If($(vButton)='Orders',

Count(distinct OrderID),

Sum(Sales)

)

Regards,

Kaushik Solanki