<?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 set analysis to get a value of previous period in Data Movement &amp; Streaming</title>
    <link>https://community.qlik.com/t5/Data-Movement-Streaming/Using-set-analysis-to-get-a-value-of-previous-period/m-p/2126371#M1482</link>
    <description>&lt;P&gt;Hi. I have a dataset with the fields: Account_id, account_score, year_quarter, YearQuarterKey (which is a running sequencial number for every year-quarter combination). I want to use set analysis in a table presentation on my app, and to add the field previous_quarter_score to every row ! in the table, according the field YearQuarterKey&lt;/P&gt;
&lt;P&gt;I tried:&lt;/P&gt;
&lt;P&gt;=max( {&amp;lt; YearQuarterKey = {"$(=(YearQuarterKey-1))"} &amp;gt;} account_score)&lt;/P&gt;
&lt;P&gt;It did not work.&lt;/P&gt;
&lt;P&gt;Any thoughts on how to accomplish this?&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;</description>
    <pubDate>Wed, 19 Mar 2025 23:02:17 GMT</pubDate>
    <dc:creator>wandoqebu</dc:creator>
    <dc:date>2025-03-19T23:02:17Z</dc:date>
    <item>
      <title>Using set analysis to get a value of previous period</title>
      <link>https://community.qlik.com/t5/Data-Movement-Streaming/Using-set-analysis-to-get-a-value-of-previous-period/m-p/2126371#M1482</link>
      <description>&lt;P&gt;Hi. I have a dataset with the fields: Account_id, account_score, year_quarter, YearQuarterKey (which is a running sequencial number for every year-quarter combination). I want to use set analysis in a table presentation on my app, and to add the field previous_quarter_score to every row ! in the table, according the field YearQuarterKey&lt;/P&gt;
&lt;P&gt;I tried:&lt;/P&gt;
&lt;P&gt;=max( {&amp;lt; YearQuarterKey = {"$(=(YearQuarterKey-1))"} &amp;gt;} account_score)&lt;/P&gt;
&lt;P&gt;It did not work.&lt;/P&gt;
&lt;P&gt;Any thoughts on how to accomplish this?&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Mar 2025 23:02:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Data-Movement-Streaming/Using-set-analysis-to-get-a-value-of-previous-period/m-p/2126371#M1482</guid>
      <dc:creator>wandoqebu</dc:creator>
      <dc:date>2025-03-19T23:02:17Z</dc:date>
    </item>
    <item>
      <title>Re: Using set analysis to get a value of previous period</title>
      <link>https://community.qlik.com/t5/Data-Movement-Streaming/Using-set-analysis-to-get-a-value-of-previous-period/m-p/2134074#M1542</link>
      <description>&lt;P&gt;Hi try this :&lt;/P&gt;
&lt;P&gt;=sum( {&amp;lt; YearQuarterKey={"$(=max({$} YearQuarterKey)-1)"} &amp;gt;} account_score)&lt;/P&gt;</description>
      <pubDate>Thu, 02 Nov 2023 11:40:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Data-Movement-Streaming/Using-set-analysis-to-get-a-value-of-previous-period/m-p/2134074#M1542</guid>
      <dc:creator>dmac1971</dc:creator>
      <dc:date>2023-11-02T11:40:44Z</dc:date>
    </item>
    <item>
      <title>Re: Using set analysis to get a value of previous period</title>
      <link>https://community.qlik.com/t5/Data-Movement-Streaming/Using-set-analysis-to-get-a-value-of-previous-period/m-p/2134099#M1543</link>
      <description>&lt;P&gt;It's not possible in this way. You could use something like:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;YearQuarterKey = {"$(=max(YearQuarterKey)&lt;STRONG&gt;-n&lt;/STRONG&gt;)"}&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;to reference to any wanted period - but you &lt;STRONG&gt;mustn't&lt;/STRONG&gt; have any of the period-fields within your object. There are various reasons for it, for example the needed $-sign expansion creates an adhoc-variable which is evaluated ones before the chart is calculated and this single result is then applied to all rows. Further such set analysis condition defines a certain selection state which didn't fits to the related dimension-value which would results in zero or NULL (there are ways to enforce to show any expression result to any dimension-value but it has so many disadvantages that it couldn't be recommended).&lt;/P&gt;
&lt;P&gt;Quite common for such scenarios is not to apply the period-field as dimension else to apply n expressions - for each wanted period an own one. Usually it are quite a few one and even if it are 12 or more - per copy &amp;amp; paste and adjusting the &lt;STRONG&gt;n&lt;/STRONG&gt; it's not difficult or needs much efforts.&lt;/P&gt;
&lt;P&gt;Another approach would be to keep the period-field and using interrecord-functions like above() or before() to access the surrounding cells within the object which would you enable to set the current and previous results side by side and comparing them.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Nov 2023 12:50:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Data-Movement-Streaming/Using-set-analysis-to-get-a-value-of-previous-period/m-p/2134099#M1543</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2023-11-02T12:50:14Z</dc:date>
    </item>
  </channel>
</rss>

