<?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: Set analysis for distinct accounts who placed their most recent order more than 60 days ago in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Set-analysis-for-distinct-accounts-who-placed-their-most-recent/m-p/1606204#M44877</link>
    <description>try changing your expression to below&lt;BR /&gt;count({&amp;lt;[ORDERDate] = {" &amp;lt;= $(=date(Today()-60, 'M/D/YYYY'))"}&amp;gt;}Distinct [Account ID])</description>
    <pubDate>Thu, 25 Jul 2019 16:20:25 GMT</pubDate>
    <dc:creator>dplr-rn</dc:creator>
    <dc:date>2019-07-25T16:20:25Z</dc:date>
    <item>
      <title>Set analysis for distinct accounts who placed their most recent order more than 60 days ago</title>
      <link>https://community.qlik.com/t5/App-Development/Set-analysis-for-distinct-accounts-who-placed-their-most-recent/m-p/1606191#M44876</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;I've been getting some mixed or inaccurate results tinkering with set analysis on the expression below.&amp;nbsp;&lt;/P&gt;&lt;P&gt;count({&amp;lt;[ORDERDate] = {"(=date(max(ORDERDate), 'M/D/YYYY')) &amp;lt;= $(=date(Today()-60, 'M/D/YYYY'))"}&amp;gt;}Distinct [Account ID])&lt;/P&gt;&lt;P&gt;&amp;nbsp; The aim is to see a KPI indicating the number of distinct accounts who last placed an order more than 60 days ago.&amp;nbsp; Ultimately I'll want to identify those past 90, and then past 120 days for other KPIs.&lt;/P&gt;&lt;P&gt;At this point I've searched through many similar questions/solutions here and online that look like they should work, but they don't. Any help is greatly appreciated.&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 05:10:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-analysis-for-distinct-accounts-who-placed-their-most-recent/m-p/1606191#M44876</guid>
      <dc:creator>Number9</dc:creator>
      <dc:date>2024-11-16T05:10:19Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis for distinct accounts who placed their most recent order more than 60 days ago</title>
      <link>https://community.qlik.com/t5/App-Development/Set-analysis-for-distinct-accounts-who-placed-their-most-recent/m-p/1606204#M44877</link>
      <description>try changing your expression to below&lt;BR /&gt;count({&amp;lt;[ORDERDate] = {" &amp;lt;= $(=date(Today()-60, 'M/D/YYYY'))"}&amp;gt;}Distinct [Account ID])</description>
      <pubDate>Thu, 25 Jul 2019 16:20:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-analysis-for-distinct-accounts-who-placed-their-most-recent/m-p/1606204#M44877</guid>
      <dc:creator>dplr-rn</dc:creator>
      <dc:date>2019-07-25T16:20:25Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis for distinct accounts who placed their most recent order more than 60 days ago</title>
      <link>https://community.qlik.com/t5/App-Development/Set-analysis-for-distinct-accounts-who-placed-their-most-recent/m-p/1606214#M44880</link>
      <description>&lt;P&gt;Thanks Dilipranjith,&lt;/P&gt;&lt;P&gt;&amp;nbsp; That does return a count of distinct Account IDs that have *any* order dates, most recent or otherwise, greater than 60 days from today, but it doesn't seem to limit to the max(ORDERDate) for an Account ID.&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example: Today is 7/25/19, if Account ID=N61234 has the following ORDERDates:&lt;/P&gt;&lt;P&gt;7/24/19&lt;/P&gt;&lt;P&gt;7/1/19&lt;/P&gt;&lt;P&gt;6/18/19&lt;/P&gt;&lt;P&gt;5/21/19&lt;/P&gt;&lt;P&gt;4/10/19&lt;/P&gt;&lt;P&gt;3/3/19&lt;/P&gt;&lt;P&gt;then the account should not appear in the results I want, as the account's most recent ORDERDate is less than 60 days ago. It does appear in the example expression you provided.&lt;/P&gt;&lt;P&gt;My aim is to get a count of only those distinct accounts who last placed an order, max(ORDERDate), more than 60 days ago.&lt;/P&gt;&lt;P&gt;Thank you again for your time and thoughts.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jul 2019 16:42:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-analysis-for-distinct-accounts-who-placed-their-most-recent/m-p/1606214#M44880</guid>
      <dc:creator>Number9</dc:creator>
      <dc:date>2019-07-25T16:42:30Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis for distinct accounts who placed their most recent order more than 60 days ago</title>
      <link>https://community.qlik.com/t5/App-Development/Set-analysis-for-distinct-accounts-who-placed-their-most-recent/m-p/1606219#M44883</link>
      <description>&lt;P&gt;Ok.&lt;/P&gt;&lt;P&gt;that will not be possible with straightforward set analysis. you would need aggr function etc.&lt;/P&gt;&lt;P&gt;if you can share some sample data i can try and help.&lt;/P&gt;&lt;P&gt;But it Maybe simpler to mark the maximum date for each account with a flag.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jul 2019 17:15:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-analysis-for-distinct-accounts-who-placed-their-most-recent/m-p/1606219#M44883</guid>
      <dc:creator>dplr-rn</dc:creator>
      <dc:date>2019-07-25T17:15:57Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis for distinct accounts who placed their most recent order more than 60 days ago</title>
      <link>https://community.qlik.com/t5/App-Development/Set-analysis-for-distinct-accounts-who-placed-their-most-recent/m-p/1606234#M44886</link>
      <description>&lt;P&gt;There isn't a way to handle this with a nested set analysis? Seems strange to me that this can't work straightforwardly outside of a load script. My data set is large, and changing daily as new orders come in. I'll look to provide a sample in a bit. Thanks again.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jul 2019 17:53:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-analysis-for-distinct-accounts-who-placed-their-most-recent/m-p/1606234#M44886</guid>
      <dc:creator>Number9</dc:creator>
      <dc:date>2019-07-25T17:53:47Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis for distinct accounts who placed their most recent order more than 60 days ago</title>
      <link>https://community.qlik.com/t5/App-Development/Set-analysis-for-distinct-accounts-who-placed-their-most-recent/m-p/1606237#M44888</link>
      <description>&lt;P&gt;it can but it would need aggr function in the nested set.&lt;/P&gt;&lt;P&gt;because set analysis is calculated once. so Max(Order Date) is calculated once for the entire set not per id. hence the need for aggr function&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jul 2019 17:57:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-analysis-for-distinct-accounts-who-placed-their-most-recent/m-p/1606237#M44888</guid>
      <dc:creator>dplr-rn</dc:creator>
      <dc:date>2019-07-25T17:57:00Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis for distinct accounts who placed their most recent order more than 60 days ago</title>
      <link>https://community.qlik.com/t5/App-Development/Set-analysis-for-distinct-accounts-who-placed-their-most-recent/m-p/1608106#M45116</link>
      <description>&lt;P&gt;Ultimately I just went with a max flag field in my load script as suggested by Dilipranjith:&lt;/P&gt;&lt;P&gt;LEFT JOIN (mytable) LOAD&lt;/P&gt;&lt;P&gt;[Account ID],&lt;/P&gt;&lt;P&gt;DATE(MAX([ORDERDate])) AS [ORDERDate],&lt;/P&gt;&lt;P&gt;1 AS [MAXFLAG]&lt;/P&gt;&lt;P&gt;RESIDENT mytable&lt;/P&gt;&lt;P&gt;GROUP BY [Account ID];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then applied a very simple set analysis:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Count({&amp;lt;ORDERDate = {"&amp;lt;=$(=Date(Today()- 60,'M/D/YYYY'))"}, MAXFLAG = {"1"}&amp;gt;}Distinct [Account ID])&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can apply this to all date ranges for my needs. I still would prefer a set analysis solution to this particular problem, but in the end the load script works reliably for now. Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jul 2019 14:36:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-analysis-for-distinct-accounts-who-placed-their-most-recent/m-p/1608106#M45116</guid>
      <dc:creator>Number9</dc:creator>
      <dc:date>2019-07-31T14:36:53Z</dc:date>
    </item>
  </channel>
</rss>

