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: 
david_pearson
Contributor III
Contributor III

QSVariable Extension on flat table

Hi,

i have a flat data table that purely shows the results of any changes made using Qlik filters. i have now added some variable buttons to remove the need for so many filters. this changes my charts as this is all based on counts and sums i.e.if(vType = 1, Sum(POLICYCOUNT),
if(vType=2, sum({<RTM={'GCS Stand Alone'}>}POLICYCOUNT),
If(vType=3, sum({<RTM={'SME Stand Alone'}>}POLICYCOUNT),
if(vType=4,Sum({<RTM={'SME Add-on','GCS Add-on'}>}POLICYCOUNT)))))

 

however how do i restrict my table to only desplay data based on a set criteria. This only shows columns with NO measures. What i want to do is select a variable button (button 2) and for it to restrict the data where column "RTM" = "GCS Stand Alone", button 2 "RTM" = "SME Stand Alone" etc. It seems like it should be obvious but im going round in circles. appears that you can only do it using an agr which i dont need to do. is it not as simple as =if(vType=1, RTM = {'GCS Stand Alone'},if(vType=2,RTM={'SME Stand Alone'})) ???

 

Thanks

Labels (1)
2 Replies
vmoreno2605
Creator
Creator

I don't think i understood it all, however you can try this
You can try this
if(vType=1,if(RTM=' GCS Stand Alone', RTM),
if(vType=2,if(RTM=' SME Stand Alone', RTM)
))
I hope it helps
ogster1974
Partner - Master II
Partner - Master II

I think you are saying you have measures being dynamically set with a button and now you want to do the same for dimensions i.e column RTM.

So let's break this down if you wanted to restrict this table to only a particular dimension value you'd create a calculated dimension in master dimensions. Something like...

If(RTM='GCS Stand Alone', RTM, Null())

Then exclude null values in your table... You want to take this a step further and make the dimension value dynamic. To do this setup your buttons under your new variable and do something like

If(RTM='$(vType)', RTM, Null())

Or Nest the ifs if you want to store a number in the variable instead of your dimension values.