Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

qsVariable extention applying selections

Hello everyone,

I am not sure if you have expertise with the qsVariable extention, but I thought I would give the question a shot. I am attempting to create a slider (using the qsVariable extension or any other way) to select the top X amount of product lines. I have the slider working to display the proper data when I move the slider in a bar chart.

I basically just set a limitation based on the variable and the number of product lines display as I move the slider, which is good.

All I would like now is that the product lines become selected when I move the slider so the KPIs and other objects on the sheet will respond and drill down on the selections made by the variable slider.

Another way to ask is, is it possible to apply selections through variables?

If you have any thoughts, let me know.

Thanks,

6 Replies
jonvitale
Creator III
Creator III

Russell,

Sure, I do a lot of this. Let's say you have a variable "myVar", you can write a set analysis like this.

Sum({<myFieldToFilter = {'$(=$(myVar))'} >} myFieldToSum)

Let me know if this works for you.

Jonathan

Anonymous
Not applicable
Author

Hi Jonathan,

Where would the set analysis go? Currently I have Product Lines displayed and Revenue as my measure. The qsVariable extension gives me the ability to have a dynamic value in the variable.

How do the selections get made?

Do you use qsVariable?

Thanks

Anonymous
Not applicable
Author

Also when I say filter, I mean I want it to apply selections as I move the slider around.

Thanks!

jonvitale
Creator III
Creator III

Russell,

I haven't used the qsVariable extension, but the Sheet Navigation and Actions button, https://github.com/stefanwalther/sense-navigation

I assume the qsVariable works similarly by setting a variable value each time the user changes moves the slider.

By including the set analysis, {<myFieldToFilter = {'$(=$(myVar))'} >}

in the definition of the measure, every time the user moves the slider the measure will change.


In your particular case you might want something like:

Sum({<[Product Lines] = {'$(=$(vSelectedProductLine))'} >} Revenues)


But, I'm not sure I completely understand what trouble you are having. Do you have the definition of the measure handy?

Anonymous
Not applicable
Author

Hi Jonathan,

The measure is just revenue and the Dimension is product line. I was able to visually see in the chart the additional product lines when I move the slider because I set the limitation based on the qsVariable (so when the slider moves the product lines appear and disappear because I am allowing the chart to display more or less).

You are correct the qsVariable allows you to change the variable expression by moving the slider or typing in a number.

All I want to do in addition to that is have more or less product lines become selected and therefore activate the KPIs on the page when I move the slider. When they become selected, a filter should show up on top saying 1 of 49 product lines etc... so when I move the slider it is as if I clicked the bars in the bar chart.

Does that make more sense?

jonvitale
Creator III
Creator III

Oh, so you want to actually impact your field selections through the variable? Is that right?

If so, I don't know if you can do that. I think it would have to be an option built into qsVariable because it would require the API. I don't think there is any way to do this from the user side. The Sheet Navigation and Actions has this option for a button - you can select the action to filter specific values based on a formula when clicked.

Sorry, I couldn't be of help