Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
ashima_0605
Contributor III
Contributor III

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
Anil_Babu_Samineni

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))

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
ashima_0605
Contributor III
Contributor III
Author

Hi,

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

Qlik1_User1
Specialist
Specialist

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.