<?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 Sum participants with set expression in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Sum-participants-with-set-expression/m-p/1824458#M67701</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;i have a variable in script:&lt;/P&gt;&lt;P&gt;let vPriorBookingDate = 'date(addyears(SP_BookingDate,-1))'; to make a previous year date and in a straight table&lt;/P&gt;&lt;P&gt;i have dimension SP_Booking date and in expression&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Dimension&lt;/TD&gt;&lt;TD&gt;sum for current date&lt;/TD&gt;&lt;TD&gt;sum for previous year date&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;SP_BookingDate ( 2021-07-26)&lt;/TD&gt;&lt;TD&gt;123&lt;/TD&gt;&lt;TD&gt;123&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to with&amp;nbsp;sum({$&amp;lt;SP_BookingDate={"=$(vPriorBookingDate)"}&amp;gt;}SP_ParticipantsCount) sum values in 2020-07-26 but it shows exact same values as in current booking date&lt;/P&gt;&lt;P&gt;is there any possibility to do it correctly?&lt;/P&gt;&lt;P&gt;Thanks for all help and have a nice day!&lt;/P&gt;</description>
    <pubDate>Mon, 26 Jul 2021 10:11:23 GMT</pubDate>
    <dc:creator>Woojtek_96</dc:creator>
    <dc:date>2021-07-26T10:11:23Z</dc:date>
    <item>
      <title>Sum participants with set expression</title>
      <link>https://community.qlik.com/t5/App-Development/Sum-participants-with-set-expression/m-p/1824458#M67701</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;i have a variable in script:&lt;/P&gt;&lt;P&gt;let vPriorBookingDate = 'date(addyears(SP_BookingDate,-1))'; to make a previous year date and in a straight table&lt;/P&gt;&lt;P&gt;i have dimension SP_Booking date and in expression&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Dimension&lt;/TD&gt;&lt;TD&gt;sum for current date&lt;/TD&gt;&lt;TD&gt;sum for previous year date&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;SP_BookingDate ( 2021-07-26)&lt;/TD&gt;&lt;TD&gt;123&lt;/TD&gt;&lt;TD&gt;123&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to with&amp;nbsp;sum({$&amp;lt;SP_BookingDate={"=$(vPriorBookingDate)"}&amp;gt;}SP_ParticipantsCount) sum values in 2020-07-26 but it shows exact same values as in current booking date&lt;/P&gt;&lt;P&gt;is there any possibility to do it correctly?&lt;/P&gt;&lt;P&gt;Thanks for all help and have a nice day!&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jul 2021 10:11:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sum-participants-with-set-expression/m-p/1824458#M67701</guid>
      <dc:creator>Woojtek_96</dc:creator>
      <dc:date>2021-07-26T10:11:23Z</dc:date>
    </item>
    <item>
      <title>Re: Sum participants with set expression</title>
      <link>https://community.qlik.com/t5/App-Development/Sum-participants-with-set-expression/m-p/1824577#M67712</link>
      <description>&lt;P&gt;Do not try and use set analysis to set a dimension value for a dimension in a table (SP_BookingDate).&lt;/P&gt;&lt;P&gt;1) You can create a previous year metric in the data model associated to the current date&lt;/P&gt;&lt;P&gt;ex.&amp;nbsp;&lt;/P&gt;&lt;P&gt;left join (factTable)&lt;/P&gt;&lt;P&gt;&amp;nbsp; load&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;addyears(&lt;SPAN&gt;SP_BookingDate,1) as&amp;nbsp;SP_BookingDate&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;sum(field) as PreviousYearMetric&lt;/P&gt;&lt;P&gt;&amp;nbsp; resident factTable&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2) or you can create a field that isn't qualified by year ("DayMonth"), so records for 2021, 2020, 2019 etc can all have the same value for DayMonth, ex. 07-26.&amp;nbsp; Then in your front-end you can use set analysis for Year = $(currentYear) and Year = $(previousYear).&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jul 2021 17:32:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sum-participants-with-set-expression/m-p/1824577#M67712</guid>
      <dc:creator>bgl-sjoyce</dc:creator>
      <dc:date>2021-07-26T17:32:05Z</dc:date>
    </item>
  </channel>
</rss>

