<?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: Complex set analysis using ranges and max dates for each dimension value in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Complex-set-analysis-using-ranges-and-max-dates-for-each/m-p/1708787#M455607</link>
    <description>&lt;P&gt;hi&amp;nbsp;&lt;/P&gt;&lt;P&gt;this should solve your question&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;FirstSortedValue({&amp;lt;Date1={"&amp;lt;=$(=date(Max(Date1)+vDayCounter))"}&amp;gt;}  aggr( sum({&amp;lt;Date1={"&amp;lt;=$(=date(Max(Date1)+vDayCounter))"}&amp;gt;}Amount),Date1,Article) ,-Date1)&lt;/LI-CODE&gt;&lt;P&gt;also attach is your demo model&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 07 Jun 2020 05:44:26 GMT</pubDate>
    <dc:creator>lironbaram</dc:creator>
    <dc:date>2020-06-07T05:44:26Z</dc:date>
    <item>
      <title>Complex set analysis using ranges and max dates for each dimension value</title>
      <link>https://community.qlik.com/t5/QlikView/Complex-set-analysis-using-ranges-and-max-dates-for-each/m-p/1708762#M455606</link>
      <description>&lt;P&gt;Hi all!&lt;/P&gt;&lt;P&gt;This is being a very challenging problem what I am facing, hope you can help me.&lt;/P&gt;&lt;P&gt;I'm attaching an example Excel file and a .qvw file with loaded data. There, you can see we have sold article amounts by date and article.&lt;/P&gt;&lt;TABLE width="256"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="76"&gt;Date1&lt;/TD&gt;&lt;TD width="116"&gt;Article&lt;/TD&gt;&lt;TD width="64"&gt;Amount&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;01/01/2020&lt;/TD&gt;&lt;TD&gt;Art1&lt;/TD&gt;&lt;TD&gt;100&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;02/01/2020&lt;/TD&gt;&lt;TD&gt;Art1&lt;/TD&gt;&lt;TD&gt;200&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;06/01/2020&lt;/TD&gt;&lt;TD&gt;Art1&lt;/TD&gt;&lt;TD&gt;300&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;07/01/2020&lt;/TD&gt;&lt;TD&gt;Art1&lt;/TD&gt;&lt;TD&gt;400&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;02/01/2020&lt;/TD&gt;&lt;TD&gt;Art2&lt;/TD&gt;&lt;TD&gt;500&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;03/01/2020&lt;/TD&gt;&lt;TD&gt;Art2&lt;/TD&gt;&lt;TD&gt;600&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;09/01/2020&lt;/TD&gt;&lt;TD&gt;Art2&lt;/TD&gt;&lt;TD&gt;700&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;10/01/2020&lt;/TD&gt;&lt;TD&gt;Art2&lt;/TD&gt;&lt;TD&gt;800&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;This is the problem: the end user has the possibility to use a selector and write a offset value for the date -in this example, for simplifying purposes, I'm adding to year's first day so many days as vDayCounter variable says. Then, having this calculated date as reference, I need to get the amount corresponding to the maximum date for each article, being this date lower than the calculated date.&lt;/P&gt;&lt;P&gt;Using this table as example, let's say you set vDayCounter=4. So, our calculated day will be 05/01/2020. Then this means we want this amounts:&lt;/P&gt;&lt;TABLE width="204"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="76"&gt;Date1&lt;/TD&gt;&lt;TD width="64"&gt;Article&lt;/TD&gt;&lt;TD width="64"&gt;Amount&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;02/01/2020&lt;/TD&gt;&lt;TD&gt;Art1&lt;/TD&gt;&lt;TD&gt;200&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;03/01/2020&lt;/TD&gt;&lt;TD&gt;Art2&lt;/TD&gt;&lt;TD&gt;600&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried AGGR to obtain dates at article level, combining with Max() function, but it didn't work anyway.&lt;/P&gt;&lt;P&gt;Thanks in advance for your interest!&lt;/P&gt;&lt;P&gt;Miguel&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 18:31:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Complex-set-analysis-using-ranges-and-max-dates-for-each/m-p/1708762#M455606</guid>
      <dc:creator>m_baroja</dc:creator>
      <dc:date>2024-11-16T18:31:36Z</dc:date>
    </item>
    <item>
      <title>Re: Complex set analysis using ranges and max dates for each dimension value</title>
      <link>https://community.qlik.com/t5/QlikView/Complex-set-analysis-using-ranges-and-max-dates-for-each/m-p/1708787#M455607</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;/P&gt;&lt;P&gt;this should solve your question&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;FirstSortedValue({&amp;lt;Date1={"&amp;lt;=$(=date(Max(Date1)+vDayCounter))"}&amp;gt;}  aggr( sum({&amp;lt;Date1={"&amp;lt;=$(=date(Max(Date1)+vDayCounter))"}&amp;gt;}Amount),Date1,Article) ,-Date1)&lt;/LI-CODE&gt;&lt;P&gt;also attach is your demo model&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 07 Jun 2020 05:44:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Complex-set-analysis-using-ranges-and-max-dates-for-each/m-p/1708787#M455607</guid>
      <dc:creator>lironbaram</dc:creator>
      <dc:date>2020-06-07T05:44:26Z</dc:date>
    </item>
    <item>
      <title>Re: Complex set analysis using ranges and max dates for each dimension value</title>
      <link>https://community.qlik.com/t5/QlikView/Complex-set-analysis-using-ranges-and-max-dates-for-each/m-p/1708844#M455608</link>
      <description>&lt;P&gt;Very nice. It works!&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Sun, 07 Jun 2020 17:12:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Complex-set-analysis-using-ranges-and-max-dates-for-each/m-p/1708844#M455608</guid>
      <dc:creator>m_baroja</dc:creator>
      <dc:date>2020-06-07T17:12:46Z</dc:date>
    </item>
  </channel>
</rss>

