Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
RichardLinderman
Contributor II
Contributor II

Slider to Decrease a Number in a Field by Percentage

So I'm going to add a slider to my work. This slider is meant to represent percentage, so it will remain between 0 and 100. I have a KPI with a number, and what I want to happen is, when the slider is increased to a particular percentage, the percentage of the KPI number is subtracted. Can someone tell me what functions to type and where?

Labels (3)
1 Solution

Accepted Solutions
LRuCelver
Partner - Creator III
Partner - Creator III

  1. Create a variable and give it a meaningful name, e.g. "vKPIReductionPercentage". If you want it to have a default value, add "Let vKPIReductionPercentage = YourValue;" to the script. (Replace "YourValue" with your default value.)
  2. Create a slider for the variable and set the lower and upper bounds to 0 and 100.
  3. Multiply your KPI with "(1-$(vKPIReductionPercentage)/100)"

LRuCelver_0-1709902309548.png

 

View solution in original post

3 Replies
LRuCelver
Partner - Creator III
Partner - Creator III

  1. Create a variable and give it a meaningful name, e.g. "vKPIReductionPercentage". If you want it to have a default value, add "Let vKPIReductionPercentage = YourValue;" to the script. (Replace "YourValue" with your default value.)
  2. Create a slider for the variable and set the lower and upper bounds to 0 and 100.
  3. Multiply your KPI with "(1-$(vKPIReductionPercentage)/100)"

LRuCelver_0-1709902309548.png

 

RichardLinderman
Contributor II
Contributor II
Author

So, is "Let vKPIReductionPercentage = YourValue;" to be typed in the Definition box? If not, what should be?

LRuCelver
Partner - Creator III
Partner - Creator III

If you always want e.g. 0% as the default value, add "Let vKPIReductionPercentage = 0;" to the load script.

You can also create variables in the variable editor (bottom left corner when editing a sheet).