<?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 Parameterised Variable but in an Expression table in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Parameterised-Variable-but-in-an-Expression-table/m-p/1786189#M1210063</link>
    <description>&lt;P&gt;Hi All&lt;/P&gt;&lt;P&gt;I'm trying to use the amazing functionality of a parametrised varaible e.g. var=sum($1+$2) so var(a,b)=sum(a+b) but I'm trying to go one stage further and use this functionaity in expressions from a table, so I can store multiple expressions based on dimension choice but on a parameterised basis as what you can do in variables.&lt;/P&gt;&lt;P&gt;If it helps, I've included a simple app with a step by step attempt.&lt;/P&gt;&lt;P&gt;So I've got a data table with two rows of data with the value fields (a, b and c)&lt;/P&gt;&lt;P&gt;I currently have two calculation functions (but I want many in reality, hence why want to store in table rather than individual variables). So I've created two parameterised variables:&lt;/P&gt;&lt;P&gt;vAddFunc=sum($1+$2)&lt;/P&gt;&lt;P&gt;vMultiFunc=&amp;nbsp;sum($1*$2)&lt;/P&gt;&lt;P&gt;In example 1, I can call each function in the table expression and use any of the data columns (so I'm using a and b in my example).&lt;/P&gt;&lt;P&gt;Switching %Field from Add to Multiply chooses each function. However each is it's own variable and requires either conditional expressions in table to pick correct variable or I would need an if statement. So this is not scalable in what I'm looking to do e.g. add many other functions using same parameters e.g. Divide, Double, Subtract etc&lt;/P&gt;&lt;P&gt;So, I look to another neat solution which is to store the expressions in a table that the expression can be recalled by reading that table. So example 2 in the middle shows this 'without' the parametrised variables i.e. fixed expressions for a and b. Here, as you select %Field it determines which expression to use.&lt;/P&gt;&lt;P&gt;So to my final example, I am now trying to merge the two i.e. recall and expression from a table but utilise the parameter functionality of a variable. So I've tried mashing both together (using a variable to recall the table expression which has $ parameters) but I can get it to work &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; .&lt;/P&gt;&lt;P&gt;Is this just not possible or have a missed out something in my expression definition?&lt;/P&gt;&lt;P&gt;My thanks in advance for any genius suggestions&lt;/P&gt;&lt;P&gt;Derek&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;</description>
    <pubDate>Thu, 25 Feb 2021 16:01:35 GMT</pubDate>
    <dc:creator>derekjones</dc:creator>
    <dc:date>2021-02-25T16:01:35Z</dc:date>
    <item>
      <title>Parameterised Variable but in an Expression table</title>
      <link>https://community.qlik.com/t5/QlikView/Parameterised-Variable-but-in-an-Expression-table/m-p/1786189#M1210063</link>
      <description>&lt;P&gt;Hi All&lt;/P&gt;&lt;P&gt;I'm trying to use the amazing functionality of a parametrised varaible e.g. var=sum($1+$2) so var(a,b)=sum(a+b) but I'm trying to go one stage further and use this functionaity in expressions from a table, so I can store multiple expressions based on dimension choice but on a parameterised basis as what you can do in variables.&lt;/P&gt;&lt;P&gt;If it helps, I've included a simple app with a step by step attempt.&lt;/P&gt;&lt;P&gt;So I've got a data table with two rows of data with the value fields (a, b and c)&lt;/P&gt;&lt;P&gt;I currently have two calculation functions (but I want many in reality, hence why want to store in table rather than individual variables). So I've created two parameterised variables:&lt;/P&gt;&lt;P&gt;vAddFunc=sum($1+$2)&lt;/P&gt;&lt;P&gt;vMultiFunc=&amp;nbsp;sum($1*$2)&lt;/P&gt;&lt;P&gt;In example 1, I can call each function in the table expression and use any of the data columns (so I'm using a and b in my example).&lt;/P&gt;&lt;P&gt;Switching %Field from Add to Multiply chooses each function. However each is it's own variable and requires either conditional expressions in table to pick correct variable or I would need an if statement. So this is not scalable in what I'm looking to do e.g. add many other functions using same parameters e.g. Divide, Double, Subtract etc&lt;/P&gt;&lt;P&gt;So, I look to another neat solution which is to store the expressions in a table that the expression can be recalled by reading that table. So example 2 in the middle shows this 'without' the parametrised variables i.e. fixed expressions for a and b. Here, as you select %Field it determines which expression to use.&lt;/P&gt;&lt;P&gt;So to my final example, I am now trying to merge the two i.e. recall and expression from a table but utilise the parameter functionality of a variable. So I've tried mashing both together (using a variable to recall the table expression which has $ parameters) but I can get it to work &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; .&lt;/P&gt;&lt;P&gt;Is this just not possible or have a missed out something in my expression definition?&lt;/P&gt;&lt;P&gt;My thanks in advance for any genius suggestions&lt;/P&gt;&lt;P&gt;Derek&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;</description>
      <pubDate>Thu, 25 Feb 2021 16:01:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Parameterised-Variable-but-in-an-Expression-table/m-p/1786189#M1210063</guid>
      <dc:creator>derekjones</dc:creator>
      <dc:date>2021-02-25T16:01:35Z</dc:date>
    </item>
    <item>
      <title>Re: Parameterised Variable but in an Expression table</title>
      <link>https://community.qlik.com/t5/QlikView/Parameterised-Variable-but-in-an-Expression-table/m-p/1786302#M1210082</link>
      <description>&lt;P&gt;I solved it myself, working Example 3 attached for anyone that has the same issue or would like to use this functionality.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Feb 2021 16:51:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Parameterised-Variable-but-in-an-Expression-table/m-p/1786302#M1210082</guid>
      <dc:creator>derekjones</dc:creator>
      <dc:date>2021-02-25T16:51:28Z</dc:date>
    </item>
  </channel>
</rss>

