6 Replies Latest reply: Dec 1, 2017 4:45 PM by Jonathan Vitale RSS

    qsVariable extention applying selections

    Russell Glenn

      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.




        • Re: qsVariable extention applying selections
          Jonathan Vitale



          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.



          • Re: qsVariable extention applying selections
            Jonathan Vitale



            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?

              • Re: qsVariable extention applying selections
                Russell Glenn

                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?

                  • Re: qsVariable extention applying selections
                    Jonathan Vitale

                    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