Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
mwallman
Creator III
Creator III

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
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Change code to below.

If($(vButton)='Orders',

Count(distinct OrderID),

Sum(Sales)

)

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!