<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Scenario Planning Model - Applying different input variables to each category within a field in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Scenario-Planning-Model-Applying-different-input-variables-to/m-p/1587812#M63077</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;TLDR:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I needed to do something similar to the person in this post:&amp;nbsp;&lt;A href="https://community.qlik.com/t5/Qlik-Sense-App-Development/InputField-and-InputSum-in-QlikSense/td-p/43151" target="_blank"&gt;https://community.qlik.com/t5/Qlik-Sense-App-Development/InputField-and-InputSum-in-QlikSense/td-p/4...&lt;/A&gt;.&amp;nbsp; What I am trying to understand is how do you create an input variable for each category (because they require different calculations) without using nested if statements. I dont think nested if statements will work because the combination of input variables will require 50+ nested if statements.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Background:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;In order to accomplish this, I created a basic scenario planning table in haste without spending too much time on thinking about how to model it properly. The goal of the model is&amp;nbsp; to analyze cost savings based on inputs. It is a simple model, you have one variable (Level) and seven categories within Level (1-7). Using the variable extension, seven different sliders are used (because they have different calculations), so that you can adjust each category accordingly. Below is sample code. As you can see,&amp;nbsp; all the calculations are in the front end, uses nested IF formulas, its really messy and I am sure there is a much cleaner way of doing this. Not to mention, this code is repeated, for each business, this is just for one business.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;if([ELT Level]=1 and count({$&amp;lt;SBU={"US"},[Is Manager]={"No"}&amp;gt;}[Full Name])&amp;lt;=0, (sum({$&amp;lt;SBU={"US"},[Is Manager]={"No"}&amp;gt;}Median)+(median({1&amp;lt;[Is Manager]={"No"}&amp;gt;}[Median])*vUSnumemp1)),&lt;BR /&gt;if([ELT Level]=1,(sum({$&amp;lt;SBU={"US"},[Is Manager]={"No"}&amp;gt;}Median)+(median({$&amp;lt;SBU={"US"},[Is Manager]={"No"}&amp;gt;}[Median])*vUSnumemp1)),&lt;BR /&gt;if([ELT Level]=2 AND count({$&amp;lt;SBU={"US"},[Is Manager]={"No"}&amp;gt;}[Full Name])&amp;lt;=0, (sum({$&amp;lt;SBU={"US"},[Is Manager]={"No"}&amp;gt;}Median)+(median({1&amp;lt;[Is Manager]={"No"}&amp;gt;}[Median])*vUSnumemp2)),&lt;BR /&gt;if([ELT Level]=2,(sum({$&amp;lt;SBU={"US"},[Is Manager]={"No"}&amp;gt;}Median)+(median({$&amp;lt;SBU={"US"},[Is Manager]={"No"}&amp;gt;}[Median])*vUSnumemp2)),&lt;BR /&gt;if([ELT Level]=3 and count({$&amp;lt;SBU={"US"},[Is Manager]={"No"}&amp;gt;}[Full Name])&amp;lt;=0, (sum({$&amp;lt;SBU={"US"},[Is Manager]={"No"}&amp;gt;}Median)+(median({1&amp;lt;[Is Manager]={"No"}&amp;gt;}[Median])*vUSnumemp3)),&lt;BR /&gt;if([ELT Level]=3,(sum({$&amp;lt;SBU={"US"},[Is Manager]={"No"}&amp;gt;}Median)+(median({$&amp;lt;SBU={"US"},[Is Manager]={"No"}&amp;gt;}[Median])*vUSnumemp3)),&lt;BR /&gt;if([ELT Level]=4 and count({$&amp;lt;SBU={"US"},[Is Manager]={"No"}&amp;gt;}[Full Name])&amp;lt;=0, (sum({$&amp;lt;SBU={"US"},[Is Manager]={"No"}&amp;gt;}Median)+(median({1&amp;lt;[Is Manager]={"No"}&amp;gt;}[Median])*vUSnumemp4)),&lt;BR /&gt;if([ELT Level]=4,(sum({$&amp;lt;SBU={"US"},[Is Manager]={"No"}&amp;gt;}Median)+(median({$&amp;lt;SBU={"US"},[Is Manager]={"No"}&amp;gt;}[Median])*vUSnumemp4)),&lt;BR /&gt;if([ELT Level]=5 and count({$&amp;lt;SBU={"US"},[Is Manager]={"No"}&amp;gt;}[Full Name])&amp;lt;=0, (sum({$&amp;lt;SBU={"US"},[Is Manager]={"No"}&amp;gt;}Median)+(median({1&amp;lt;[Is Manager]={"No"}&amp;gt;}[Median])*vUSnumemp5)),&lt;BR /&gt;if([ELT Level]=5,(sum({$&amp;lt;SBU={"US"},[Is Manager]={"No"}&amp;gt;}Median)+(median({$&amp;lt;SBU={"US"},[Is Manager]={"No"}&amp;gt;}[Median])*vUSnumemp5)),&lt;BR /&gt;if([ELT Level]=6 and count({$&amp;lt;SBU={"US"},[Is Manager]={"No"}&amp;gt;}[Full Name])&amp;lt;=0, (sum({$&amp;lt;SBU={"US"},[Is Manager]={"No"}&amp;gt;}Median)+(median({1&amp;lt;[Is Manager]={"No"}&amp;gt;}[Median])*vUSnumemp6)),&lt;BR /&gt;if([ELT Level]=6,(sum({$&amp;lt;SBU={"US"},[Is Manager]={"No"}&amp;gt;}Median)+(median({$&amp;lt;SBU={"US"},[Is Manager]={"No"}&amp;gt;}[Median])*vUSnumemp6)),&lt;BR /&gt;if([ELT Level]=7 and count({$&amp;lt;SBU={"US"},[Is Manager]={"No"}&amp;gt;}[Full Name])&amp;lt;=0, (sum({$&amp;lt;SBU={"US"},[Is Manager]={"No"}&amp;gt;}Median)+(median({1&amp;lt;[Is Manager]={"No"}&amp;gt;}[Median])*vUSnumemp7)),&lt;BR /&gt;if([ELT Level]=7,(sum({$&amp;lt;SBU={"US"},[Is Manager]={"No"}&amp;gt;}Median)+(median({$&amp;lt;SBU={"US"},[Is Manager]={"No"}&amp;gt;}[Median])*vUSnumemp7)),&lt;BR /&gt;if([ELT Level]=8 and count({$&amp;lt;SBU={"US"},[Is Manager]={"No"}&amp;gt;}[Full Name])&amp;lt;=0, (sum({$&amp;lt;SBU={"US"},[Is Manager]={"No"}&amp;gt;}Median)+(median({1&amp;lt;[Is Manager]={"No"}&amp;gt;}[Median])*vUSnumemp8)),&lt;BR /&gt;if([ELT Level]=8,(sum({$&amp;lt;SBU={"US"},[Is Manager]={"No"}&amp;gt;}Median)+(median({$&amp;lt;SBU={"US"},[Is Manager]={"No"}&amp;gt;}[Median])*vUSnumemp8)),&lt;BR /&gt;0&lt;BR /&gt;))))))))))))))))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now I need to make the model more complex by adding another variable (city) that has 15 categories, but the functionality still needs to remain the same, adjust the input by level AND city&amp;nbsp; which if I use this same approach, would require like ~50+ nested if formulas. I suspect this will decrease performance, but also, simply bothers me as it is ugly code.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So my question is, how do I do this in a more concise, clean manner. One thought I had was creating another table,&amp;nbsp; which lists the cost of every combination (i.e., level by city), and than applying the variable to that table. However, I am still unsure on how to get around using the nested if statements so that each input is correctly applied to the right combination, which is really what I am trying to understand. I tried using set analysis, but it applies the input variable to all of the categories, rather than just one.&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 02 Apr 2021 07:57:33 GMT</pubDate>
    <dc:creator>rizaster</dc:creator>
    <dc:date>2021-04-02T07:57:33Z</dc:date>
    <item>
      <title>Scenario Planning Model - Applying different input variables to each category within a field</title>
      <link>https://community.qlik.com/t5/App-Development/Scenario-Planning-Model-Applying-different-input-variables-to/m-p/1587812#M63077</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;TLDR:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I needed to do something similar to the person in this post:&amp;nbsp;&lt;A href="https://community.qlik.com/t5/Qlik-Sense-App-Development/InputField-and-InputSum-in-QlikSense/td-p/43151" target="_blank"&gt;https://community.qlik.com/t5/Qlik-Sense-App-Development/InputField-and-InputSum-in-QlikSense/td-p/4...&lt;/A&gt;.&amp;nbsp; What I am trying to understand is how do you create an input variable for each category (because they require different calculations) without using nested if statements. I dont think nested if statements will work because the combination of input variables will require 50+ nested if statements.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Background:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;In order to accomplish this, I created a basic scenario planning table in haste without spending too much time on thinking about how to model it properly. The goal of the model is&amp;nbsp; to analyze cost savings based on inputs. It is a simple model, you have one variable (Level) and seven categories within Level (1-7). Using the variable extension, seven different sliders are used (because they have different calculations), so that you can adjust each category accordingly. Below is sample code. As you can see,&amp;nbsp; all the calculations are in the front end, uses nested IF formulas, its really messy and I am sure there is a much cleaner way of doing this. Not to mention, this code is repeated, for each business, this is just for one business.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;if([ELT Level]=1 and count({$&amp;lt;SBU={"US"},[Is Manager]={"No"}&amp;gt;}[Full Name])&amp;lt;=0, (sum({$&amp;lt;SBU={"US"},[Is Manager]={"No"}&amp;gt;}Median)+(median({1&amp;lt;[Is Manager]={"No"}&amp;gt;}[Median])*vUSnumemp1)),&lt;BR /&gt;if([ELT Level]=1,(sum({$&amp;lt;SBU={"US"},[Is Manager]={"No"}&amp;gt;}Median)+(median({$&amp;lt;SBU={"US"},[Is Manager]={"No"}&amp;gt;}[Median])*vUSnumemp1)),&lt;BR /&gt;if([ELT Level]=2 AND count({$&amp;lt;SBU={"US"},[Is Manager]={"No"}&amp;gt;}[Full Name])&amp;lt;=0, (sum({$&amp;lt;SBU={"US"},[Is Manager]={"No"}&amp;gt;}Median)+(median({1&amp;lt;[Is Manager]={"No"}&amp;gt;}[Median])*vUSnumemp2)),&lt;BR /&gt;if([ELT Level]=2,(sum({$&amp;lt;SBU={"US"},[Is Manager]={"No"}&amp;gt;}Median)+(median({$&amp;lt;SBU={"US"},[Is Manager]={"No"}&amp;gt;}[Median])*vUSnumemp2)),&lt;BR /&gt;if([ELT Level]=3 and count({$&amp;lt;SBU={"US"},[Is Manager]={"No"}&amp;gt;}[Full Name])&amp;lt;=0, (sum({$&amp;lt;SBU={"US"},[Is Manager]={"No"}&amp;gt;}Median)+(median({1&amp;lt;[Is Manager]={"No"}&amp;gt;}[Median])*vUSnumemp3)),&lt;BR /&gt;if([ELT Level]=3,(sum({$&amp;lt;SBU={"US"},[Is Manager]={"No"}&amp;gt;}Median)+(median({$&amp;lt;SBU={"US"},[Is Manager]={"No"}&amp;gt;}[Median])*vUSnumemp3)),&lt;BR /&gt;if([ELT Level]=4 and count({$&amp;lt;SBU={"US"},[Is Manager]={"No"}&amp;gt;}[Full Name])&amp;lt;=0, (sum({$&amp;lt;SBU={"US"},[Is Manager]={"No"}&amp;gt;}Median)+(median({1&amp;lt;[Is Manager]={"No"}&amp;gt;}[Median])*vUSnumemp4)),&lt;BR /&gt;if([ELT Level]=4,(sum({$&amp;lt;SBU={"US"},[Is Manager]={"No"}&amp;gt;}Median)+(median({$&amp;lt;SBU={"US"},[Is Manager]={"No"}&amp;gt;}[Median])*vUSnumemp4)),&lt;BR /&gt;if([ELT Level]=5 and count({$&amp;lt;SBU={"US"},[Is Manager]={"No"}&amp;gt;}[Full Name])&amp;lt;=0, (sum({$&amp;lt;SBU={"US"},[Is Manager]={"No"}&amp;gt;}Median)+(median({1&amp;lt;[Is Manager]={"No"}&amp;gt;}[Median])*vUSnumemp5)),&lt;BR /&gt;if([ELT Level]=5,(sum({$&amp;lt;SBU={"US"},[Is Manager]={"No"}&amp;gt;}Median)+(median({$&amp;lt;SBU={"US"},[Is Manager]={"No"}&amp;gt;}[Median])*vUSnumemp5)),&lt;BR /&gt;if([ELT Level]=6 and count({$&amp;lt;SBU={"US"},[Is Manager]={"No"}&amp;gt;}[Full Name])&amp;lt;=0, (sum({$&amp;lt;SBU={"US"},[Is Manager]={"No"}&amp;gt;}Median)+(median({1&amp;lt;[Is Manager]={"No"}&amp;gt;}[Median])*vUSnumemp6)),&lt;BR /&gt;if([ELT Level]=6,(sum({$&amp;lt;SBU={"US"},[Is Manager]={"No"}&amp;gt;}Median)+(median({$&amp;lt;SBU={"US"},[Is Manager]={"No"}&amp;gt;}[Median])*vUSnumemp6)),&lt;BR /&gt;if([ELT Level]=7 and count({$&amp;lt;SBU={"US"},[Is Manager]={"No"}&amp;gt;}[Full Name])&amp;lt;=0, (sum({$&amp;lt;SBU={"US"},[Is Manager]={"No"}&amp;gt;}Median)+(median({1&amp;lt;[Is Manager]={"No"}&amp;gt;}[Median])*vUSnumemp7)),&lt;BR /&gt;if([ELT Level]=7,(sum({$&amp;lt;SBU={"US"},[Is Manager]={"No"}&amp;gt;}Median)+(median({$&amp;lt;SBU={"US"},[Is Manager]={"No"}&amp;gt;}[Median])*vUSnumemp7)),&lt;BR /&gt;if([ELT Level]=8 and count({$&amp;lt;SBU={"US"},[Is Manager]={"No"}&amp;gt;}[Full Name])&amp;lt;=0, (sum({$&amp;lt;SBU={"US"},[Is Manager]={"No"}&amp;gt;}Median)+(median({1&amp;lt;[Is Manager]={"No"}&amp;gt;}[Median])*vUSnumemp8)),&lt;BR /&gt;if([ELT Level]=8,(sum({$&amp;lt;SBU={"US"},[Is Manager]={"No"}&amp;gt;}Median)+(median({$&amp;lt;SBU={"US"},[Is Manager]={"No"}&amp;gt;}[Median])*vUSnumemp8)),&lt;BR /&gt;0&lt;BR /&gt;))))))))))))))))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now I need to make the model more complex by adding another variable (city) that has 15 categories, but the functionality still needs to remain the same, adjust the input by level AND city&amp;nbsp; which if I use this same approach, would require like ~50+ nested if formulas. I suspect this will decrease performance, but also, simply bothers me as it is ugly code.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So my question is, how do I do this in a more concise, clean manner. One thought I had was creating another table,&amp;nbsp; which lists the cost of every combination (i.e., level by city), and than applying the variable to that table. However, I am still unsure on how to get around using the nested if statements so that each input is correctly applied to the right combination, which is really what I am trying to understand. I tried using set analysis, but it applies the input variable to all of the categories, rather than just one.&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Apr 2021 07:57:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Scenario-Planning-Model-Applying-different-input-variables-to/m-p/1587812#M63077</guid>
      <dc:creator>rizaster</dc:creator>
      <dc:date>2021-04-02T07:57:33Z</dc:date>
    </item>
    <item>
      <title>Re: Scenario Planning Model - Applying different input variables to each category within a field</title>
      <link>https://community.qlik.com/t5/App-Development/Scenario-Planning-Model-Applying-different-input-variables-to/m-p/1588795#M63078</link>
      <description>&lt;P&gt;What these variables contain&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;vUSnumemp1 (2,3,4,5,6,7,8) ?&lt;/STRONG&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Why don't you load a seperate field that contains the levels like&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;LevelsField:

LOAD * INLINE [

    Level

1

2

3

4

5

7

];
&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then in your Set Analysis&lt;/P&gt;&lt;P&gt;use getcurrentselect() function to get the list of values selected in the dashboard, if you select value 1 on from field &lt;STRONG&gt;LevelsField&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;getcurrentselection() : LevelsField:1&lt;/P&gt;&lt;P&gt;if you select year = 2019 for example&lt;/P&gt;&lt;P&gt;getcurrentselection() returns : LevelsField:1, Year:2019&lt;/P&gt;&lt;P&gt;So use wildmatch to focus one the fields that you want to use for calculation with wildmatch()&lt;/P&gt;&lt;P&gt;Wildmatch(getcurrentselection(), "LevelsField:*") : returns everything that contains LevelsField&lt;/P&gt;&lt;P&gt;Now, you can use substring methods to extract the values selected in that string like mid(..)&lt;/P&gt;&lt;P&gt;In case for example&amp;nbsp;&lt;STRONG&gt;Wildmatch(getcurrentselection(), "LevelsField:*") rerurns&amp;nbsp;LevelsField:1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;mid(&lt;STRONG&gt;Wildmatch(getcurrentselection(), "LevelsField:*")&lt;/STRONG&gt;,13,1) will return &lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;which is the value you can use to filter you calculation in set expression&lt;/P&gt;&lt;P&gt;the same for Country, let say you have Country field representing country with two characters&lt;/P&gt;&lt;P&gt;mid(&lt;STRONG&gt;Wildmatch(getcurrentselection(), "Country:*")&lt;/STRONG&gt;,8,2) will return &lt;STRONG&gt;US&lt;/STRONG&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;Sum({&amp;lt;LevelsField = {mid(Wildmatch(getcurrentselection(), "LevelsField:*"),13,1)},

Country = {mid(Wildmatch(getcurrentselection(), "Country:*"),8,2)}&amp;gt;}Values)&lt;/LI-CODE&gt;&lt;P&gt;I am writing the logic without any trials so the goal is to avoid using if(), and translate the logical thingking into a set analysis expresssion, because this way even if you have 120 values selected you don't care, because the expression simply filters the field based on the selected values on Dashboard.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope that helps &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jun 2019 01:57:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Scenario-Planning-Model-Applying-different-input-variables-to/m-p/1588795#M63078</guid>
      <dc:creator>lazurens</dc:creator>
      <dc:date>2019-06-06T01:57:38Z</dc:date>
    </item>
    <item>
      <title>Re: Scenario Planning Model - Applying different input variables to each category within a field</title>
      <link>https://community.qlik.com/t5/App-Development/Scenario-Planning-Model-Applying-different-input-variables-to/m-p/1589278#M63079</link>
      <description>&lt;P&gt;Thanks for the response Lazurens! But Im not sure if this will fit my needs. In the dashboard, there are no selections made for Level. To clarify, a person adjusts the sliders for each level, which in turn adjusts the table (or chart) for each level. I have attached screenshots of the tool to help demonstrate.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jun 2019 22:19:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Scenario-Planning-Model-Applying-different-input-variables-to/m-p/1589278#M63079</guid>
      <dc:creator>rizaster</dc:creator>
      <dc:date>2019-06-06T22:19:26Z</dc:date>
    </item>
    <item>
      <title>Re: Scenario Planning Model - Applying different input variables to each category within a field</title>
      <link>https://community.qlik.com/t5/App-Development/Scenario-Planning-Model-Applying-different-input-variables-to/m-p/1590544#M63080</link>
      <description>bump</description>
      <pubDate>Tue, 11 Jun 2019 14:55:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Scenario-Planning-Model-Applying-different-input-variables-to/m-p/1590544#M63080</guid>
      <dc:creator>rizaster</dc:creator>
      <dc:date>2019-06-11T14:55:14Z</dc:date>
    </item>
    <item>
      <title>Re: Scenario Planning Model - Applying different input variables to each category within a field</title>
      <link>https://community.qlik.com/t5/App-Development/Scenario-Planning-Model-Applying-different-input-variables-to/m-p/1591290#M63081</link>
      <description>&lt;P&gt;I will suggest the following idea, and excuse me if I did not provide some well developed example I just present the concept here .&lt;/P&gt;&lt;P&gt;The idea is to create a table that contains the formulas that you want to compute based on the sliders of the simulation&lt;/P&gt;&lt;P&gt;this table also contains all the possible individual formulas, each row is linked to dimensions&lt;/P&gt;&lt;P&gt;the selections on the dimensions will lead only one row in the expressions table, as soon as you have got this result the problem is solved and the user selections led to the desired formulas that should be calculated without using the if() statement.&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="Setexpression mdeling.JPG" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/13664i33B2D47A64002936/image-dimensions/400x205?v=v2" width="400" height="205" role="button" title="Setexpression mdeling.JPG" alt="Setexpression mdeling.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;Sales:
Load * INLINE [
ID, Canal, Country, Date, SalesAmounts, ExpressionsID
1, A, US, 01/1/2018, 300,1US
2, B, FR, 03/3/2018, 1000,2FR
3, A, FR, 30/6/2018, 2000,
4, C, TN, 05/6/2019, 5000,3TN
];


SetExpressions:
Load * INLINE [
IDE, Country_, Expression,ExpressionsID
1, US, sum(10),1US
2, FR, sum(20),2FR
3, TN, sum(30),3TN
];&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is a simple example, table sales is linked to many formulas {Sum(10), Sum(20), Sum(30)}, each expression is linked the appropriate case in the sales table with keys (1US, 2FR, 3TN) you can automate the key creation easily with concat() afterwards, I want you to focus on the idea.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the Dashboard now, I will disply the desired field:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="Selections.JPG" style="width: 803px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/13665i0B1AF10BC2F83726/image-size/large?v=v2&amp;amp;px=999" role="button" title="Selections.JPG" alt="Selections.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As you can See, as soon as you filter by country there is only one possible key in the field "IDE" that is linked to the desired formula for country France, the only thing we need to do now, is get that expression&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;FieldValue('Expression',concat(IDE))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;concat(IDE): will return the possible values of the field [IDE] which should be only one value, then with the interrecord function FieldValue() we get the text of the formula from the field Expression&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Sum.JPG" style="width: 530px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/13668i2A4E0AD75ECFD4AF/image-size/large?v=v2&amp;amp;px=999" role="button" title="Sum.JPG" alt="Sum.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Now you can use this concept to design the linkage between your dimensions and the expressions that you want to calculate and based on those selections you get the desired expressions, for the cases that you want to display 0, just force the links to end up into 0 for certain selections and you will never need an if() &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Of course you need to put in plain text your expressions : Sum({&amp;lt;SetAnalaysis&amp;gt;}Field)&lt;/P&gt;&lt;P&gt;I hope this helps.&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jun 2019 00:33:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Scenario-Planning-Model-Applying-different-input-variables-to/m-p/1591290#M63081</guid>
      <dc:creator>lazurens</dc:creator>
      <dc:date>2019-06-13T00:33:20Z</dc:date>
    </item>
    <item>
      <title>Re: Scenario Planning Model - Applying different input variables to each category within a field</title>
      <link>https://community.qlik.com/t5/App-Development/Scenario-Planning-Model-Applying-different-input-variables-to/m-p/1591503#M63082</link>
      <description>&lt;P&gt;I have made a simple example to demonstrate my idea of how approach the problem of having different formulas for different selections.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First, I created a table that contains individual formulas for each case, second I would link each formula (each row) to the corresponding selection(s) for example I have three countries (US, FR, TN) and for each one of them I have a different calculation, I create a unique key (US is linked to the first formula, FR is linked to the second, and TN is linked to the third)&lt;/P&gt;&lt;P&gt;This way I translate the logical problem into a schematic representation that could computed automatically using interrecord functions to build all the combinations you have.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Sales:
Load * INLINE [
ID, Canal, Country, Date, SalesAmounts, ExpressionsID
1, A, US, 01/1/2018, 300,1US
2, B, FR, 03/3/2018, 1000,2FR
3, A, FR, 30/6/2018, 2000,
4, C, TN, 05/6/2019, 5000,3TN
];


SetExpressions:
Load * INLINE [
IDE, Country_, Expression,ExpressionsID
1, US, sum(10),1US
2, FR, sum(20),2FR
3, TN, sum(30),3TN
];&lt;/LI-CODE&gt;&lt;P&gt;Now I have SetExpression table linked to each case in the sales table, so I can display the one formula that corresponds the selected country.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Model.JPG" style="width: 433px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/13699i8D79E9F9FB89CAD1/image-dimensions/433x207?v=v2" width="433" height="207" role="button" title="Model.JPG" alt="Model.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Initially, I have all possible selection (1,2 and 3) when there is no country selected&lt;/P&gt;&lt;P&gt;concat(IDE): returns possible values of the field ID Expression&lt;/P&gt;&lt;P&gt;Fieldvalue('Expression', concat(IDE)): returns the exression itself of the possible value&lt;/P&gt;&lt;P&gt;So as soon as we have only one possible value, the KPI could be calculated automaticallybase on the selection.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Initial state.JPG" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/13700iBC3AD7430BC6246A/image-size/large?v=v2&amp;amp;px=999" role="button" title="Initial state.JPG" alt="Initial state.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;As you can see now, I select the country (FR), the IDE would have only the expression of ID 2, so the KPI could execute that expression&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="End state.JPG" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/13701i61D5B681ADEB1D26/image-size/large?v=v2&amp;amp;px=999" role="button" title="End state.JPG" alt="End state.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;You can build upon this concept, and add more combinations, for example if you want to add male/female, then you should create a unique key that concatenates Expression ID, Country, and Gender as soon as you select country only nothing happens because you still have more possible values for males and females, and when you select male for example the possible values of ID expression will be reduced to only one possible value and you are done.&amp;nbsp;&lt;/P&gt;&lt;P&gt;As I said this is a simple example, I made very fast to demonstrate the concept, and I hope it would help you.&amp;nbsp;&lt;/P&gt;&lt;P&gt;From performance point of view, no IF is needed at all, and you can even go beyound and add flags to the Expression table and use set expression to control more the set of expressions you have and maybe ignore the ones you dislike to compute.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Mohamed&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jun 2019 10:44:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Scenario-Planning-Model-Applying-different-input-variables-to/m-p/1591503#M63082</guid>
      <dc:creator>lazurens</dc:creator>
      <dc:date>2019-06-13T10:44:53Z</dc:date>
    </item>
    <item>
      <title>Re: Scenario Planning Model - Applying different input variables to each category within a field</title>
      <link>https://community.qlik.com/t5/App-Development/Scenario-Planning-Model-Applying-different-input-variables-to/m-p/1591802#M63085</link>
      <description>&lt;P&gt;Thanks Mohamed! I think this is getting me in the right direction, but I am still not fully understanding, how do you incorporate a slider so that it adjusts on the row level for a table, keeping in mind that the table must remain static.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using your example, if we have a table with all of the countries listed, in this case, there are three, how can i create a slider for each so that it adjusts the row accordingly. Keeping in mind, the table must remain static, meaning, that all the countries must be listed at all times, there is no filtering. If the table were to be dynamic, i.e., selecting a country, which displays the country in the table and accordingly the associated formula, i think your solution would work, but in my case I need the table to remain the same, just the content in the cells to update based on the input of the slider.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jun 2019 18:41:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Scenario-Planning-Model-Applying-different-input-variables-to/m-p/1591802#M63085</guid>
      <dc:creator>rizaster</dc:creator>
      <dc:date>2019-06-13T18:41:58Z</dc:date>
    </item>
    <item>
      <title>Re: Scenario Planning Model - Applying different input variables to each category within a field</title>
      <link>https://community.qlik.com/t5/App-Development/Scenario-Planning-Model-Applying-different-input-variables-to/m-p/1591835#M63086</link>
      <description>&lt;P&gt;so the "solution" I have come up with in the mean time is to use pick match, as I hear that is better for performance. However, I have a total combination of about ~5000 inputs, so unclear whether performance will remain with such a long pick/match formula. Additionally, writing that formula is going to suck. Perhaps I need to change the user design of the dashboard to reduce the number of inputs&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jun 2019 21:52:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Scenario-Planning-Model-Applying-different-input-variables-to/m-p/1591835#M63086</guid>
      <dc:creator>rizaster</dc:creator>
      <dc:date>2019-06-13T21:52:47Z</dc:date>
    </item>
    <item>
      <title>Re: Scenario Planning Model - Applying different input variables to each category within a field</title>
      <link>https://community.qlik.com/t5/App-Development/Scenario-Planning-Model-Applying-different-input-variables-to/m-p/1591879#M63087</link>
      <description>Exactely, I don't think a slider would be a useful UI component for an optimized User experience as you have more than 100 option to deal with because it's not easy to slide over 5000 options.&lt;BR /&gt;I suggest to stick basics, simple design and use field selector, that way you can type the values that you search of, and you can even add some logic in the back end to display the values that you need to display.&lt;BR /&gt;I also advice you to finish building the logic first not worry so much about the presentation of the dashboard, as soon as you are comfortable with the logic and have it tested and validated, move on and optimize the design.</description>
      <pubDate>Fri, 14 Jun 2019 06:02:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Scenario-Planning-Model-Applying-different-input-variables-to/m-p/1591879#M63087</guid>
      <dc:creator>lazurens</dc:creator>
      <dc:date>2019-06-14T06:02:59Z</dc:date>
    </item>
  </channel>
</rss>

