<?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 Using Identifiers within Set Expressions in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Using-Identifiers-within-Set-Expressions/m-p/1524910#M37701</link>
    <description>&lt;P&gt;Re: Using Identifiers within Set Expressions&lt;/P&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am having trouble with the syntax for Set Expressions.&amp;nbsp; Generally, I want to assign date values to variables, then use the variables in the set Modifier to select a range of dates.&amp;nbsp; Specifically, where I run into trouble is with the set Identifier.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Scenario 1 -&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;When the expression below is used in a KPI object, with &lt;EM&gt;no identifier,&lt;/EM&gt; it returns the proper value of 13,017.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Sum({&amp;lt;StatementDate={"&amp;gt;=$(vMaxYearStart) &amp;lt;=$(vMaxStatementDate)"}&amp;gt;} kWh)&amp;nbsp;&amp;nbsp; // Good: returns 13017&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;Scenario 2 -&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;As per the Set Expression help topic; “The Identifier $, represents the records of the current selection.” When the expression below is used, with the &lt;EM&gt;$ identifier&lt;/EM&gt;, it returns the value of 40,675 which is essentially not respecting the range specified in the set Modifier.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Sum(&lt;STRONG&gt;$&lt;/STRONG&gt;{&amp;lt;StatementDate={"&amp;gt;=$(vMaxYearStart) &amp;lt;=$(vMaxStatementDate)"}&amp;gt;} kWh)&amp;nbsp;&amp;nbsp; // Bad: returns 40675&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;Scenario 3 -&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;As per the Set Expression help topic; “The Identifier 1, represents the full set of all the records in the application, irrespective of any selections made.” &amp;nbsp;This is the identifier I want but when the expression below is used, with the &lt;EM&gt;1 identifier&lt;/EM&gt;, it returns a dash.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Sum(&lt;STRONG&gt;1&lt;/STRONG&gt;{&amp;lt;StatementDate={"&amp;gt;=$(vMaxYearStart) &amp;lt;=$(vMaxStatementDate)"}&amp;gt;} kWh)&amp;nbsp;&amp;nbsp; // Bad: returns –&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;What do I need to do differently to properly use a set identifier in my expression? My sample script is attached as well as the expressions I tested in a KPI object.&amp;nbsp; Any suggestions would be gratefully received.&amp;nbsp; Thank you in advance.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ScreenShotPivotTable.png" style="width: 804px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/2771iDB203A60E0B38540/image-size/large?v=v2&amp;amp;px=999" role="button" title="ScreenShotPivotTable.png" alt="ScreenShotPivotTable.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 28 Dec 2018 22:40:39 GMT</pubDate>
    <dc:creator>Tig</dc:creator>
    <dc:date>2018-12-28T22:40:39Z</dc:date>
    <item>
      <title>Using Identifiers within Set Expressions</title>
      <link>https://community.qlik.com/t5/App-Development/Using-Identifiers-within-Set-Expressions/m-p/1524910#M37701</link>
      <description>&lt;P&gt;Re: Using Identifiers within Set Expressions&lt;/P&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am having trouble with the syntax for Set Expressions.&amp;nbsp; Generally, I want to assign date values to variables, then use the variables in the set Modifier to select a range of dates.&amp;nbsp; Specifically, where I run into trouble is with the set Identifier.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Scenario 1 -&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;When the expression below is used in a KPI object, with &lt;EM&gt;no identifier,&lt;/EM&gt; it returns the proper value of 13,017.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Sum({&amp;lt;StatementDate={"&amp;gt;=$(vMaxYearStart) &amp;lt;=$(vMaxStatementDate)"}&amp;gt;} kWh)&amp;nbsp;&amp;nbsp; // Good: returns 13017&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;Scenario 2 -&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;As per the Set Expression help topic; “The Identifier $, represents the records of the current selection.” When the expression below is used, with the &lt;EM&gt;$ identifier&lt;/EM&gt;, it returns the value of 40,675 which is essentially not respecting the range specified in the set Modifier.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Sum(&lt;STRONG&gt;$&lt;/STRONG&gt;{&amp;lt;StatementDate={"&amp;gt;=$(vMaxYearStart) &amp;lt;=$(vMaxStatementDate)"}&amp;gt;} kWh)&amp;nbsp;&amp;nbsp; // Bad: returns 40675&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;Scenario 3 -&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;As per the Set Expression help topic; “The Identifier 1, represents the full set of all the records in the application, irrespective of any selections made.” &amp;nbsp;This is the identifier I want but when the expression below is used, with the &lt;EM&gt;1 identifier&lt;/EM&gt;, it returns a dash.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Sum(&lt;STRONG&gt;1&lt;/STRONG&gt;{&amp;lt;StatementDate={"&amp;gt;=$(vMaxYearStart) &amp;lt;=$(vMaxStatementDate)"}&amp;gt;} kWh)&amp;nbsp;&amp;nbsp; // Bad: returns –&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;What do I need to do differently to properly use a set identifier in my expression? My sample script is attached as well as the expressions I tested in a KPI object.&amp;nbsp; Any suggestions would be gratefully received.&amp;nbsp; Thank you in advance.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ScreenShotPivotTable.png" style="width: 804px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/2771iDB203A60E0B38540/image-size/large?v=v2&amp;amp;px=999" role="button" title="ScreenShotPivotTable.png" alt="ScreenShotPivotTable.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Dec 2018 22:40:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Using-Identifiers-within-Set-Expressions/m-p/1524910#M37701</guid>
      <dc:creator>Tig</dc:creator>
      <dc:date>2018-12-28T22:40:39Z</dc:date>
    </item>
    <item>
      <title>Re: Using Identifiers within Set Expressions</title>
      <link>https://community.qlik.com/t5/App-Development/Using-Identifiers-within-Set-Expressions/m-p/1524912#M37702</link>
      <description>&lt;P&gt;You are placing your identifier at the incorrect spot... it comes after the opening curly bracket &lt;FONT color="#FF0000"&gt;&lt;FONT color="#000000"&gt;(&lt;/FONT&gt;{&lt;/FONT&gt;) and before the greater than sign (&lt;FONT color="#FF0000"&gt;&amp;lt;&lt;/FONT&gt;)&lt;/P&gt;&lt;PRE&gt;Sum({&lt;FONT color="#FF0000"&gt;$&lt;/FONT&gt;&amp;lt;StatementDate={"&amp;gt;=$(vMaxYearStart) &amp;lt;=$(vMaxStatementDate)"}&amp;gt;} kWh)&lt;/PRE&gt;&lt;P&gt;or&lt;/P&gt;&lt;PRE&gt;Sum({&lt;FONT color="#FF0000"&gt;1&lt;/FONT&gt;&amp;lt;StatementDate={"&amp;gt;=$(vMaxYearStart) &amp;lt;=$(vMaxStatementDate)"}&amp;gt;} kWh)&lt;/PRE&gt;</description>
      <pubDate>Fri, 28 Dec 2018 23:58:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Using-Identifiers-within-Set-Expressions/m-p/1524912#M37702</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-12-28T23:58:06Z</dc:date>
    </item>
    <item>
      <title>Re: Using Identifiers within Set Expressions</title>
      <link>https://community.qlik.com/t5/App-Development/Using-Identifiers-within-Set-Expressions/m-p/1524913#M37703</link>
      <description>&lt;P&gt;Yes!&amp;nbsp; I feel a mixture of great joy, now that it is working, along with some shame, for having missed that simple error.&amp;nbsp; Thank you for your help Sunny.&amp;nbsp; That was awesome.&lt;/P&gt;&lt;P&gt;Tig&lt;/P&gt;</description>
      <pubDate>Sat, 29 Dec 2018 01:04:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Using-Identifiers-within-Set-Expressions/m-p/1524913#M37703</guid>
      <dc:creator>Tig</dc:creator>
      <dc:date>2018-12-29T01:04:46Z</dc:date>
    </item>
  </channel>
</rss>

