<?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 Re: Using set analysis to get a value of previous period in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Using-set-analysis-to-get-a-value-of-previous-period/m-p/2138792#M92596</link>
    <description>&lt;P&gt;The easiest way is to create 2 variables. 1 to store to maximum possible [YearQuarterKey] and the other to store the previous&amp;nbsp;[YearQuarterKey]. These variables will change based on selections made in the App. You can name the variables what ever you like, I'm just showing an example.&lt;/P&gt;
&lt;P&gt;1. YrQtrKy = Max(YearQuarterKey)&lt;/P&gt;
&lt;P&gt;2. PrevQtrKy = YrQtrKy - 1&lt;/P&gt;
&lt;P&gt;Then, in your chart you should create 2 Expressions, 1 for this Quarter's Score, and 2 for Last Quarter's Score. [Account_id] should be one of the dimensions.&lt;/P&gt;
&lt;P&gt;1.&amp;nbsp;Sum({&amp;lt;YearQuarterKey = {$(YrQtrKy )}&amp;gt;} Score)&lt;/P&gt;
&lt;P&gt;2.&amp;nbsp;Sum({&amp;lt;YearQuarterKey = {$(PrevQtrKy )}&amp;gt;} Score)&lt;/P&gt;</description>
    <pubDate>Fri, 17 Nov 2023 12:17:48 GMT</pubDate>
    <dc:creator>whiteymcaces</dc:creator>
    <dc:date>2023-11-17T12:17:48Z</dc:date>
    <item>
      <title>Using set analysis to get a value of previous period</title>
      <link>https://community.qlik.com/t5/App-Development/Using-set-analysis-to-get-a-value-of-previous-period/m-p/2138757#M92595</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>Fri, 17 Nov 2023 10:36:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Using-set-analysis-to-get-a-value-of-previous-period/m-p/2138757#M92595</guid>
      <dc:creator>itchel</dc:creator>
      <dc:date>2023-11-17T10:36:14Z</dc:date>
    </item>
    <item>
      <title>Re: Using set analysis to get a value of previous period</title>
      <link>https://community.qlik.com/t5/App-Development/Using-set-analysis-to-get-a-value-of-previous-period/m-p/2138792#M92596</link>
      <description>&lt;P&gt;The easiest way is to create 2 variables. 1 to store to maximum possible [YearQuarterKey] and the other to store the previous&amp;nbsp;[YearQuarterKey]. These variables will change based on selections made in the App. You can name the variables what ever you like, I'm just showing an example.&lt;/P&gt;
&lt;P&gt;1. YrQtrKy = Max(YearQuarterKey)&lt;/P&gt;
&lt;P&gt;2. PrevQtrKy = YrQtrKy - 1&lt;/P&gt;
&lt;P&gt;Then, in your chart you should create 2 Expressions, 1 for this Quarter's Score, and 2 for Last Quarter's Score. [Account_id] should be one of the dimensions.&lt;/P&gt;
&lt;P&gt;1.&amp;nbsp;Sum({&amp;lt;YearQuarterKey = {$(YrQtrKy )}&amp;gt;} Score)&lt;/P&gt;
&lt;P&gt;2.&amp;nbsp;Sum({&amp;lt;YearQuarterKey = {$(PrevQtrKy )}&amp;gt;} Score)&lt;/P&gt;</description>
      <pubDate>Fri, 17 Nov 2023 12:17:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Using-set-analysis-to-get-a-value-of-previous-period/m-p/2138792#M92596</guid>
      <dc:creator>whiteymcaces</dc:creator>
      <dc:date>2023-11-17T12:17:48Z</dc:date>
    </item>
  </channel>
</rss>

