<?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 with different max date for each row in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/set-analysis-with-different-max-date-for-each-row/m-p/1962616#M79355</link>
    <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/178010"&gt;@Ori&lt;/a&gt;&amp;nbsp; Could you please try something like below expression and let me know if it has worked.&lt;/P&gt;
&lt;P&gt;Sum({&amp;lt;max_opened_at={"&amp;gt;=$(=Date(Max(max_opened_at)-21,'DD/MM/YYYY'))"}&amp;gt;}sys_id)&lt;/P&gt;
&lt;P&gt;If it has resolved your issue, please like and accept it as your solution.&lt;/P&gt;</description>
    <pubDate>Sun, 31 Jul 2022 17:24:18 GMT</pubDate>
    <dc:creator>sidhiq91</dc:creator>
    <dc:date>2022-07-31T17:24:18Z</dc:date>
    <item>
      <title>set analysis with different max date for each row</title>
      <link>https://community.qlik.com/t5/App-Development/set-analysis-with-different-max-date-for-each-row/m-p/1962609#M79354</link>
      <description>&lt;P&gt;hi everyone,&lt;/P&gt;
&lt;P&gt;I have an agent table that shows for each agent when was the last time a record was opened for him/her.&lt;/P&gt;
&lt;P&gt;I want to count, considering the dimension (each agent has a different max date) how many records were opened between max date minus 21 days and the max date.&lt;/P&gt;
&lt;P&gt;so far i've seen only posts that showed the solution with hard coded dates but this doesn't suit my need because of the varying dates.&lt;/P&gt;
&lt;P&gt;this is the measure i was trying to use&lt;/P&gt;
&lt;P&gt;count({&amp;lt;opened_at = {"&amp;gt;=max(opened_at)-21"}&amp;gt;} sys_id)&lt;/P&gt;
&lt;P&gt;example table&lt;/P&gt;
&lt;TABLE width="362"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="64"&gt;agent&lt;/TD&gt;
&lt;TD width="108"&gt;max(opened_at)&lt;/TD&gt;
&lt;TD width="97"&gt;period start&lt;/TD&gt;
&lt;TD width="93"&gt;incident count&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;1&lt;/TD&gt;
&lt;TD&gt;31/07/2022&lt;/TD&gt;
&lt;TD&gt;10/07/2022&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;2&lt;/TD&gt;
&lt;TD&gt;15/07/2022&lt;/TD&gt;
&lt;TD&gt;24/06/2022&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;3&lt;/TD&gt;
&lt;TD&gt;01/07/2022&lt;/TD&gt;
&lt;TD&gt;10/06/2022&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;4&lt;/TD&gt;
&lt;TD&gt;10/06/2022&lt;/TD&gt;
&lt;TD&gt;20/05/2022&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;5&lt;/TD&gt;
&lt;TD&gt;01/06/2022&lt;/TD&gt;
&lt;TD&gt;11/05/2022&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;6&lt;/TD&gt;
&lt;TD&gt;10/06/2022&lt;/TD&gt;
&lt;TD&gt;20/05/2022&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;thanks!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 31 Jul 2022 16:17:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/set-analysis-with-different-max-date-for-each-row/m-p/1962609#M79354</guid>
      <dc:creator>Ori</dc:creator>
      <dc:date>2022-07-31T16:17:06Z</dc:date>
    </item>
    <item>
      <title>Re: set analysis with different max date for each row</title>
      <link>https://community.qlik.com/t5/App-Development/set-analysis-with-different-max-date-for-each-row/m-p/1962616#M79355</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/178010"&gt;@Ori&lt;/a&gt;&amp;nbsp; Could you please try something like below expression and let me know if it has worked.&lt;/P&gt;
&lt;P&gt;Sum({&amp;lt;max_opened_at={"&amp;gt;=$(=Date(Max(max_opened_at)-21,'DD/MM/YYYY'))"}&amp;gt;}sys_id)&lt;/P&gt;
&lt;P&gt;If it has resolved your issue, please like and accept it as your solution.&lt;/P&gt;</description>
      <pubDate>Sun, 31 Jul 2022 17:24:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/set-analysis-with-different-max-date-for-each-row/m-p/1962616#M79355</guid>
      <dc:creator>sidhiq91</dc:creator>
      <dc:date>2022-07-31T17:24:18Z</dc:date>
    </item>
    <item>
      <title>Re: set analysis with different max date for each row</title>
      <link>https://community.qlik.com/t5/App-Development/set-analysis-with-different-max-date-for-each-row/m-p/1962674#M79362</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/6188"&gt;@sidhiq91&lt;/a&gt;&amp;nbsp;and thanks for your reply,&lt;/P&gt;
&lt;P&gt;I'm afraid your solution will not work because it hard codes maxdate - 21 based on the entire dataset.&lt;/P&gt;
&lt;P&gt;what I want to do is take the row context into the equation, calculate the range for each agent and then count the amount of incidents each one had within that range.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Aug 2022 05:29:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/set-analysis-with-different-max-date-for-each-row/m-p/1962674#M79362</guid>
      <dc:creator>Ori</dc:creator>
      <dc:date>2022-08-01T05:29:59Z</dc:date>
    </item>
    <item>
      <title>Re: set analysis with different max date for each row</title>
      <link>https://community.qlik.com/t5/App-Development/set-analysis-with-different-max-date-for-each-row/m-p/1962677#M79363</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/178010"&gt;@Ori&lt;/a&gt;&amp;nbsp; If I understand correctly what you want is for each Agent we need to find if the difference between Period Start and Max_end_date is greater than 21 days and then count only those Sys_id?&lt;/P&gt;
&lt;P&gt;is that right?&lt;/P&gt;</description>
      <pubDate>Mon, 01 Aug 2022 05:35:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/set-analysis-with-different-max-date-for-each-row/m-p/1962677#M79363</guid>
      <dc:creator>sidhiq91</dc:creator>
      <dc:date>2022-08-01T05:35:42Z</dc:date>
    </item>
    <item>
      <title>Re: set analysis with different max date for each row</title>
      <link>https://community.qlik.com/t5/App-Development/set-analysis-with-different-max-date-for-each-row/m-p/1962693#M79365</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Set analysis is calculated based on entire data set. Not by individual rows.&lt;/P&gt;
&lt;P&gt;If you want by row (i.e. per Agent wise), then try like below&lt;/P&gt;
&lt;P&gt;Dim: Agent&lt;/P&gt;
&lt;P&gt;Exp: Count(Aggr(If(&lt;SPAN&gt;opened_at&amp;nbsp;&lt;/SPAN&gt;&amp;gt;=Date(Max(&lt;SPAN&gt;opened_at&amp;nbsp;&lt;/SPAN&gt;)-21), &lt;SPAN&gt;sys_id&lt;/SPAN&gt;), Agent, &lt;SPAN&gt;opened_at&lt;/SPAN&gt;))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Aug 2022 06:27:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/set-analysis-with-different-max-date-for-each-row/m-p/1962693#M79365</guid>
      <dc:creator>MayilVahanan</dc:creator>
      <dc:date>2022-08-01T06:27:57Z</dc:date>
    </item>
    <item>
      <title>Re: set analysis with different max date for each row</title>
      <link>https://community.qlik.com/t5/App-Development/set-analysis-with-different-max-date-for-each-row/m-p/1963325#M79410</link>
      <description>&lt;P&gt;thank you both for you reply!&lt;/P&gt;
&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/6188"&gt;@sidhiq91&lt;/a&gt;&amp;nbsp;exactly so&lt;/P&gt;
&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/17935"&gt;@MayilVahanan&lt;/a&gt;&amp;nbsp;I tried the formula you suggested unfortunately that didn't work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Aug 2022 11:34:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/set-analysis-with-different-max-date-for-each-row/m-p/1963325#M79410</guid>
      <dc:creator>Ori</dc:creator>
      <dc:date>2022-08-02T11:34:32Z</dc:date>
    </item>
    <item>
      <title>Re: set analysis with different max date for each row</title>
      <link>https://community.qlik.com/t5/App-Development/set-analysis-with-different-max-date-for-each-row/m-p/1963333#M79412</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/178010"&gt;@Ori&lt;/a&gt;&amp;nbsp; I tried something like below. Please let me know if this resolved your issue.&lt;/P&gt;
&lt;P&gt;In the backend:&lt;/P&gt;
&lt;P&gt;NoConcatenate&lt;BR /&gt;Temp:&lt;BR /&gt;Load agent,&lt;BR /&gt;Date(Date#(max_opened_at,'DD/MM/YYYY'),'DD/MM/YYYY') as max_opened_at,&lt;BR /&gt;Date(Date#([period start],'DD/MM/YYYY'),'DD/MM/YYYY') as [period start],&lt;BR /&gt;sys_id&lt;BR /&gt;Inline [&lt;BR /&gt;agent, max_opened_at, period start, sys_id&lt;BR /&gt;1, 31/07/2022, 20/07/2022,2 &lt;BR /&gt;2, 15/07/2022, 24/06/2022,4 &lt;BR /&gt;3, 01/07/2022, 10/06/2022,6 &lt;BR /&gt;4, 10/06/2022, 20/05/2022,8 &lt;BR /&gt;5, 01/06/2022, 17/05/2022,10 &lt;BR /&gt;6, 10/06/2022, 20/05/2022,12&lt;BR /&gt;];&lt;/P&gt;
&lt;P&gt;NoConcatenate&lt;BR /&gt;Temp1:&lt;BR /&gt;Load *,&lt;BR /&gt;if(Interval(max_opened_at-[period start],'DD')&amp;gt;=21,'Y','N') as Flag&lt;BR /&gt;Resident Temp;&lt;BR /&gt;Drop table Temp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Exit Script;&lt;/P&gt;
&lt;P&gt;In the Frontend:&lt;/P&gt;
&lt;P&gt;Sum({&amp;lt;Flag={'Y'}&amp;gt;}sys_id)&lt;/P&gt;
&lt;P&gt;If this resolves your issue, please like and accept it as a solution.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Aug 2022 11:48:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/set-analysis-with-different-max-date-for-each-row/m-p/1963333#M79412</guid>
      <dc:creator>sidhiq91</dc:creator>
      <dc:date>2022-08-02T11:48:07Z</dc:date>
    </item>
    <item>
      <title>Re: set analysis with different max date for each row</title>
      <link>https://community.qlik.com/t5/App-Development/set-analysis-with-different-max-date-for-each-row/m-p/1963355#M79418</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/6188"&gt;@sidhiq91&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/17935"&gt;@MayilVahanan&lt;/a&gt;&amp;nbsp;thank you both so much.&lt;/P&gt;
&lt;P&gt;in the end&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/17935"&gt;@MayilVahanan&lt;/a&gt;&amp;nbsp;solution was the one (with adjustments).&lt;/P&gt;
&lt;P&gt;this is how i adjusted it :&lt;/P&gt;
&lt;P&gt;sum(aggr(if(opened_at&amp;gt;=&lt;/P&gt;
&lt;P&gt;aggr(date(max(total &amp;lt;caller_id&amp;gt; opened_at)-21,'DD/MM/YYYY'),caller_id,opened_at),1,0)&lt;/P&gt;
&lt;P&gt;,caller_id,opened_at))&lt;/P&gt;</description>
      <pubDate>Tue, 02 Aug 2022 12:10:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/set-analysis-with-different-max-date-for-each-row/m-p/1963355#M79418</guid>
      <dc:creator>Ori</dc:creator>
      <dc:date>2022-08-02T12:10:56Z</dc:date>
    </item>
  </channel>
</rss>

