7 Replies Latest reply: Jan 16, 2014 6:42 AM by Daniel Roberts RSS

    Dynamically changing variables within a slider

      Hi,

       

      I have a slider. I want the slider to control a different variable depending on the users current selection. Essentially I want the slider to act in this manner:

       

      IF(IllnessGroup=HeartAttack,$(HeartAttackVariable),

      IF(IllnessGroup=Stroke, $(StrokeVariable),

      $SweepUpVariable))

       

      Can anyone suggest a way that I can do this. I tried setting the slider to a field then usering an expression but that doesn't seem to work. I also tried creating a table to store these values but couldn't get that to work either.


      Any help is greatly appreciated.


      Thanks


      Dan

        • Re: Dynamically changing variables within a slider
          Jonathan Dienst

          Dan

           

          If I understand your requirement correctly, I suggest that you create 3 sliders, one per variable and control the slider visibility using the selection in IllnessGroup.

           

          HTH

          Jonathan

          • Re: Dynamically changing variables within a slider
            Peter Cammaert

            Make sure the field IllnessGroup can have only 1 value selected at any time.

             

            Make a "template" slider. You will be making copies of this one for every IllnessGroup value. Now make any slider show up only when a specific value has been selected in IllnessGroup. Use a conditional show expression like this one:

             

                 GetFieldSelections(IllnessGroup) = 'Stroke'

             

            In every slider, change the affected variable accroding to the IllnessGroup value.

             

            It may become a lot of work if IllnessGroup hase many discrete values. And close to impossible if IllnessGroup values change over time. But I think this will fit your description.

             

            Peter

            • Re: Dynamically changing variables within a slider

              Hi,

              Thank you, both of those answers will work however it will be pretty ugly. Particularly if I end up with 100 illness groups, I'm trying to find a way that might be a little cleaner that that, otherwise I will have potentially 100 objects on a sheet with 99 of them hidden.

               

              Thanks both of you for your replies.

               

              Is there any alternative way?

                • Re: Dynamically changing variables within a slider
                  Nicole Smith

                  Why the need for 100 different variables?  Why not just have one vSlider variable?

                    • Re: Dynamically changing variables within a slider

                      Hi Nicole,

                       

                      graph.png

                      Here you can see my graph. Each of the sliders is set for a variable which is used to drive if the dot on the graph is colored red or green (if the process happened before or after the target value). Similarly it affects the values within the tables below the slider.

                       

                      This works great when I have a single 'illness group'. I however might have up to 100 illness groups. When a user filters on any one illness group I would like a preloaded set of targets to display. If a user changes a target for a specific illness group that should be saved as a variable associated to that illness group. If a user then makes a change to a target on another ilness group and comes back to the original illness group then I would want the target values to have been remembered (including the users changes that he made after the pre-loaded values were used).

                       

                      Perhaps there is another way of doing this but now you have the context of what I am aiming for.

                       

                      Thanks for any help you can provide.