Qlik Community

Ask a Question

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Talk to Experts Tuesday, January 26th at 10AM EST: Qlik Sense. REGISTER NOW
Showing results for 
Search instead for 
Did you mean: 
Contributor II
Contributor II

how to set a default value in set expression and change on selection

Hi All,

I have a scenario where I have created a table and a bar chart.

For the bar chart, I have show data using set expression for particular quarter. However when I change my quarter from the table, the bar chart doesnt change.

my expression in bar chart

Sum({<[Type] = {"Active"},Quarter = {'$(VCurrentQtr)'}, DataSource = {"AB"}>}(Value)/1000000)


But when I change the quarter in table, the bar chart doesnt change. How to ensure that by default graph will show one value and on selection in table, it should show others

Labels (1)
3 Replies

If you nothing select, show default with Max Quarter and filter as per user selection. Could be try this way?

If(GetSelectedCount(Quarter)>0, Sum({<[Type] = {"Active"},DataSource = {"AB"}>}(Value)/1000000), 

Sum({<[Type] = {"Active"},Quarter = {'$(VCurrentQtr)'}, DataSource = {"AB"}>}(Value)/1000000))

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
Contributor II
Contributor II


Thank you so much for replying quickly. The issue is that even with this code, it is not applying the filter of selected quarter.

So say,I was showing q3 by default, if I selected Q2, it should show q2 values. But it is not showing

Creator III
Creator III

try this


If(GetSelectedCount(Quarter)>0, Sum({<({<Quarter= {'$(=Max({1}Quarter))'},[Type] = {"Active"},DataSource = {"AB"}>}(Value)/1000000), 

Sum({<[Type] = {"Active"},Quarter = {'$(VCurrentQtr)'}, DataSource = {"AB"}>}(Value)/1000000))


or create a bookmark on Quarter field and set that as default.