<?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 Need help with set analys in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Need-help-with-set-analys/m-p/2534917#M108468</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have similar data like this:&lt;/P&gt;&lt;P&gt;Temp:&lt;BR /&gt;Load* inline&lt;BR /&gt;[Date,Product,Fakt&lt;BR /&gt;20251001,1, 1&lt;BR /&gt;20251015,1, 7&lt;BR /&gt;20250810,2, 5&lt;BR /&gt;20250814,2, 9&lt;BR /&gt;20241014,1, 3&lt;BR /&gt;20241003,1, 2&lt;BR /&gt;20240807,2, 4&lt;BR /&gt;20240821,2, 1&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;Temp2:&lt;BR /&gt;Load&lt;BR /&gt;Date,&lt;BR /&gt;Product,&lt;BR /&gt;Fakt,&lt;BR /&gt;Date(Date#([Date],'YYYYMMDD'),'YYYY-MM-DD') as Regdate&lt;/P&gt;&lt;P&gt;Resident Temp;&lt;/P&gt;&lt;P&gt;Drop Table Temp;&lt;/P&gt;&lt;P&gt;Master:&lt;BR /&gt;Load&lt;BR /&gt;Date,&lt;BR /&gt;Product,&lt;BR /&gt;Fakt,&lt;BR /&gt;Regdate,&lt;BR /&gt;Num(Year(Regdate) * 100 + Month(Regdate)) as Period,&lt;BR /&gt;Num(((Year(Regdate)-1)*100) + Month(Regdate))as PeriodLY&lt;/P&gt;&lt;P&gt;Resident Temp2;&lt;/P&gt;&lt;P&gt;Drop Table Temp2;&lt;/P&gt;&lt;P&gt;If a user select "Period"(one or more) then I need a set analysis to return the sum of "Fakt" for each product for the same period last year.&lt;BR /&gt;This need to work in a straight table in a chart.&lt;BR /&gt;Can someone please help me with that? Best regards/Patric&lt;/P&gt;</description>
    <pubDate>Fri, 31 Oct 2025 08:00:56 GMT</pubDate>
    <dc:creator>Tugge1</dc:creator>
    <dc:date>2025-10-31T08:00:56Z</dc:date>
    <item>
      <title>Need help with set analys</title>
      <link>https://community.qlik.com/t5/App-Development/Need-help-with-set-analys/m-p/2534917#M108468</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have similar data like this:&lt;/P&gt;&lt;P&gt;Temp:&lt;BR /&gt;Load* inline&lt;BR /&gt;[Date,Product,Fakt&lt;BR /&gt;20251001,1, 1&lt;BR /&gt;20251015,1, 7&lt;BR /&gt;20250810,2, 5&lt;BR /&gt;20250814,2, 9&lt;BR /&gt;20241014,1, 3&lt;BR /&gt;20241003,1, 2&lt;BR /&gt;20240807,2, 4&lt;BR /&gt;20240821,2, 1&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;Temp2:&lt;BR /&gt;Load&lt;BR /&gt;Date,&lt;BR /&gt;Product,&lt;BR /&gt;Fakt,&lt;BR /&gt;Date(Date#([Date],'YYYYMMDD'),'YYYY-MM-DD') as Regdate&lt;/P&gt;&lt;P&gt;Resident Temp;&lt;/P&gt;&lt;P&gt;Drop Table Temp;&lt;/P&gt;&lt;P&gt;Master:&lt;BR /&gt;Load&lt;BR /&gt;Date,&lt;BR /&gt;Product,&lt;BR /&gt;Fakt,&lt;BR /&gt;Regdate,&lt;BR /&gt;Num(Year(Regdate) * 100 + Month(Regdate)) as Period,&lt;BR /&gt;Num(((Year(Regdate)-1)*100) + Month(Regdate))as PeriodLY&lt;/P&gt;&lt;P&gt;Resident Temp2;&lt;/P&gt;&lt;P&gt;Drop Table Temp2;&lt;/P&gt;&lt;P&gt;If a user select "Period"(one or more) then I need a set analysis to return the sum of "Fakt" for each product for the same period last year.&lt;BR /&gt;This need to work in a straight table in a chart.&lt;BR /&gt;Can someone please help me with that? Best regards/Patric&lt;/P&gt;</description>
      <pubDate>Fri, 31 Oct 2025 08:00:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Need-help-with-set-analys/m-p/2534917#M108468</guid>
      <dc:creator>Tugge1</dc:creator>
      <dc:date>2025-10-31T08:00:56Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with set analys</title>
      <link>https://community.qlik.com/t5/App-Development/Need-help-with-set-analys/m-p/2534935#M108470</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/220886"&gt;@Tugge1&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The first thing I note from the script is that you can do away with the temporary table by using a &lt;A href="https://www.quickintelligence.co.uk/preceding-load-qlikview/" target="_self"&gt;preceding load&lt;/A&gt;. The Temp2 part can sit on top of the first load like this:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Load&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Date,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Product,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Fakt,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Date(Date#([Date],'YYYYMMDD'),'YYYY-MM-DD') as Regdate&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;inline&lt;BR /&gt;[Date,Product,Fakt&lt;BR /&gt;20251001,1, 1&lt;BR /&gt;20251015,1, 7&lt;BR /&gt;20250810,2, 5&lt;BR /&gt;20250814,2, 9&lt;BR /&gt;20241014,1, 3&lt;BR /&gt;20241003,1, 2&lt;BR /&gt;20240807,2, 4&lt;BR /&gt;20240821,2, 1&lt;BR /&gt;];&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;That's got nothing to do with set analysis, but it could make your load scripts more performant and clearer to read.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If you want to compare just the latest month with the corresponding previous you would have something like this for the latest month:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;sum({&amp;lt;Regdate={'$(=date(max(Regdate),'YYYY-MM-DD'))"}&amp;gt;}Fakt)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;The expression for the same period prior month would be:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;sum({&amp;lt;Regdate={'$(=date(addmonths(max(Regdate),-12),'YYYY-MM-DD'))"}&amp;gt;}Fakt)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;It's always worth testing set analysis expressions like that by putting them into a table with&amp;nbsp;&lt;STRONG&gt;Regdate&lt;/STRONG&gt; as a dimension, you should then see that the first will only have a value on the 2025-10-01 row and the second on the 2024-10-01 row.&lt;/P&gt;&lt;P&gt;The other thing I would suggest is changing the date format for the period to be&amp;nbsp;&lt;STRONG&gt;MMM-YYYY&lt;/STRONG&gt;, as you don't need to see the 1st on each period. This format needs to match exactly in both the load script and set analysis.&lt;/P&gt;&lt;P&gt;I've done a blog post, with an example you can download, on prior period analysis here:&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.quickintelligence.co.uk/prior-period-comparison/" target="_blank"&gt;https://www.quickintelligence.co.uk/prior-period-comparison/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Hope that helps,&lt;/P&gt;&lt;P&gt;Steve&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Oct 2025 10:06:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Need-help-with-set-analys/m-p/2534935#M108470</guid>
      <dc:creator>stevedark</dc:creator>
      <dc:date>2025-10-31T10:06:08Z</dc:date>
    </item>
  </channel>
</rss>

