<?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 Dynamic Set expressions in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Dynamic-Set-expressions/m-p/1780736#M60743</link>
    <description>&lt;P&gt;Just exploring.. Set expressions and code maintenance&amp;nbsp; &amp;amp; re-usability aspect..&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there any other/better way to maintain and reuse set expressions.. ?&lt;/P&gt;&lt;P&gt;Below is sample example I have created to demonstrate the current setup..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="php"&gt;//Base Sales expression
vSales = Sum( { &amp;lt;Active = {1}, $1, $2 &amp;gt;} Sales)
//Product P1 Sales
vSalesP1 = vSales(Product = {'P1'})
//Region R1 Sales
vSalesR1 = vSales(Region = {'R1'})
//Region R1 Sales and Department D1
vSalesD1R1= vSales( Region = {'R1'}, Department= {'D1'} )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 16 Nov 2024 00:40:01 GMT</pubDate>
    <dc:creator>PradeepK</dc:creator>
    <dc:date>2024-11-16T00:40:01Z</dc:date>
    <item>
      <title>Dynamic Set expressions</title>
      <link>https://community.qlik.com/t5/App-Development/Dynamic-Set-expressions/m-p/1780736#M60743</link>
      <description>&lt;P&gt;Just exploring.. Set expressions and code maintenance&amp;nbsp; &amp;amp; re-usability aspect..&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there any other/better way to maintain and reuse set expressions.. ?&lt;/P&gt;&lt;P&gt;Below is sample example I have created to demonstrate the current setup..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="php"&gt;//Base Sales expression
vSales = Sum( { &amp;lt;Active = {1}, $1, $2 &amp;gt;} Sales)
//Product P1 Sales
vSalesP1 = vSales(Product = {'P1'})
//Region R1 Sales
vSalesR1 = vSales(Region = {'R1'})
//Region R1 Sales and Department D1
vSalesD1R1= vSales( Region = {'R1'}, Department= {'D1'} )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 00:40:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Dynamic-Set-expressions/m-p/1780736#M60743</guid>
      <dc:creator>PradeepK</dc:creator>
      <dc:date>2024-11-16T00:40:01Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Set expressions</title>
      <link>https://community.qlik.com/t5/App-Development/Dynamic-Set-expressions/m-p/1780748#M60744</link>
      <description>&lt;P&gt;One way is to assign the set expression in a variable and then use $-sign expansion.&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sum( {&amp;lt; $(xSetRegion) ,&amp;nbsp; $(xSetDepartment)&amp;nbsp; &amp;gt;} Sales)&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;where variable xSetRegion&amp;nbsp; is assigned value Region = {"R1"}, and xSetDepartment is assigned value&amp;nbsp; Department = {"D1"}&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can reuse the variable in other expressions.&lt;/P&gt;</description>
      <pubDate>Sun, 07 Feb 2021 20:45:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Dynamic-Set-expressions/m-p/1780748#M60744</guid>
      <dc:creator>skamath1</dc:creator>
      <dc:date>2021-02-07T20:45:21Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Set expressions</title>
      <link>https://community.qlik.com/t5/App-Development/Dynamic-Set-expressions/m-p/1781301#M60801</link>
      <description>&lt;P&gt;To use a variable like vSales could be quite useful but creating a whole bunch of them like in your example for (nearly) each combination of products/region/department/whatever is the opposite - what would be the benefit against writing the expressions directly? Beside this your approach based of the nesting of variables - in general it's possible but often it creates more complexity as it solved - therefore I don't recommend it (at least not as a general way to apply expressions).&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;</description>
      <pubDate>Tue, 09 Feb 2021 16:10:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Dynamic-Set-expressions/m-p/1781301#M60801</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2021-02-09T16:10:32Z</dc:date>
    </item>
  </channel>
</rss>

