<?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: Max Date, Set Analysis in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Max-Date-Set-Analysis/m-p/1536755#M746159</link>
    <description>&lt;P&gt;I've added a file with data including a detached table showing the result I'm aiming for = 285. (Except that I also need to include a minimim date &amp;gt; "Date Prise RDV", but that one I think managed to solve &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thank you for your help&lt;/P&gt;</description>
    <pubDate>Tue, 29 Jan 2019 19:26:50 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2019-01-29T19:26:50Z</dc:date>
    <item>
      <title>Max Date, Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Max-Date-Set-Analysis/m-p/1536608#M746152</link>
      <description>&lt;P&gt;Hi!&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've been&amp;nbsp;fighting with this one for a while, but now I give up and ask for your help &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As an example I have some marketing campaigns that I'm running every month (Direct mails to database). I know the month of the campaigns and now I would like to know the effect of them (effect is here measured as the number of appointments!). A person on the database might be targeted with a new campaign 6 months later so I would like to add an "end" to when I attribute the effect the a campaign. Let's say if you react within 90 days of the mailing I'll attribute that to the mailing.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've succeeded in creating a measure that takes account for a max date:&lt;/P&gt;&lt;PRE&gt;count({&amp;lt;AppointmentParent={'Nouveau RDV'}, 
Date_Key = {"=Date_Key&amp;lt;=$(=num(max([Date Prise RDV])+90))"}
 &amp;gt;} RDV_ID)&lt;/PRE&gt;&lt;P&gt;The correct result I'm looking for is 285, but I'm getting 302. UNLESS I select the available campaign dates (Date Prise RDV) in January, then I get the correct number of 285.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas&amp;nbsp;to how I can account for it in the measure? Not sure if it's the write wording, but am I somehow missing a "Group By" clause per client or campaign date?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help welcome, thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Without selection of dates (Jan = 302)" style="width: 819px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/4725iE381F8B34FD7DD09/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="Without selection of dates (Jan = 302)" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Without selection of dates (Jan = 302)&lt;/span&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="With selection of dates (Jan = 285) and correct" style="width: 821px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/4726i297E6E1B30882856/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="With selection of dates (Jan = 285) and correct" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;With selection of dates (Jan = 285) and correct&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Max-Date-Set-Analysis/m-p/1536608#M746152</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Max Date, Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Max-Date-Set-Analysis/m-p/1536651#M746153</link>
      <description>&lt;P&gt;May be try this&lt;/P&gt;&lt;PRE&gt;Count({&amp;lt;AppointmentParent = {'Nouveau RDV'}, 
RDV_ID = {"=Date_Key &amp;lt;= $(=Num(Max([Date Prise RDV])+90))"}
 &amp;gt;} RDV_ID)&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Jan 2019 16:34:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Max-Date-Set-Analysis/m-p/1536651#M746153</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-01-29T16:34:41Z</dc:date>
    </item>
    <item>
      <title>Re: Max Date, Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Max-Date-Set-Analysis/m-p/1536679#M746154</link>
      <description>&lt;P&gt;Hi Sunny&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your feedback. I hadn't thought about putting the statement like that. Unfortunately it gives the same result.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Jan 2019 17:17:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Max-Date-Set-Analysis/m-p/1536679#M746154</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-01-29T17:17:35Z</dc:date>
    </item>
    <item>
      <title>Re: Max Date, Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Max-Date-Set-Analysis/m-p/1536682#M746155</link>
      <description>&lt;P&gt;I think the Dollar sign expansion is causing this issue... seems like you need something like this&lt;/P&gt;&lt;PRE&gt;Count({&amp;lt;&lt;BR /&gt;  AppointmentParent = {'Nouveau RDV'}, 
  RDV_ID = {"=Date_Key - 90 &amp;lt;= Aggr(Max(TOTAL &amp;lt;Campaign&amp;gt; [Date Prise RDV]), RDV_ID, Campaign)"}&lt;BR /&gt;&amp;gt;} RDV_ID)&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Jan 2019 17:21:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Max-Date-Set-Analysis/m-p/1536682#M746155</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-01-29T17:21:33Z</dc:date>
    </item>
    <item>
      <title>Re: Max Date, Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Max-Date-Set-Analysis/m-p/1536719#M746156</link>
      <description>&lt;P&gt;Thanks Sunny&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm ending up with the same result. Do you reckon it's a matter of my data structure? I'm wondering if it's really solvable with an expression.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can group per client (PER_ID) as well, but that doesn't give me the result I'm looking for either.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Jan 2019 18:22:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Max-Date-Set-Analysis/m-p/1536719#M746156</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-01-29T18:22:16Z</dc:date>
    </item>
    <item>
      <title>Re: Max Date, Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Max-Date-Set-Analysis/m-p/1536723#M746157</link>
      <description>&lt;P&gt;Are you able to share a sample to see what you have?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Jan 2019 18:31:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Max-Date-Set-Analysis/m-p/1536723#M746157</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-01-29T18:31:00Z</dc:date>
    </item>
    <item>
      <title>Re: Max Date, Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Max-Date-Set-Analysis/m-p/1536728#M746158</link>
      <description>&lt;P&gt;I'll try if I can grab the data out, I understand it's not easy to help without it &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've dug a bit into the records and seem to have identified when I encounter the issue. It's basically when someone has booked an appointment both within the perimeter (within 90 days) and then again after +90 days. What happens is that two appointments are counted. If both Appointments where within I would like to count them twice, but not when it outside.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Attached screenshot maybe help explain. Below a client that has booked 3 appointments. Here it is calcualted correctly with only 2 appointments, but if I don't have any filters applied it will calculate 3 appointments.&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 720px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/4746iB27BCB822B957942/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Jan 2019 18:42:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Max-Date-Set-Analysis/m-p/1536728#M746158</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-01-29T18:42:35Z</dc:date>
    </item>
    <item>
      <title>Re: Max Date, Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Max-Date-Set-Analysis/m-p/1536755#M746159</link>
      <description>&lt;P&gt;I've added a file with data including a detached table showing the result I'm aiming for = 285. (Except that I also need to include a minimim date &amp;gt; "Date Prise RDV", but that one I think managed to solve &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thank you for your help&lt;/P&gt;</description>
      <pubDate>Tue, 29 Jan 2019 19:26:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Max-Date-Set-Analysis/m-p/1536755#M746159</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-01-29T19:26:50Z</dc:date>
    </item>
    <item>
      <title>Re: Max Date, Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Max-Date-Set-Analysis/m-p/1536772#M746162</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;&lt;PRE&gt;=Sum({&amp;lt;AppointmentParent={'Nouveau RDV'}&amp;gt;}Aggr(If(Date_Key &amp;lt;= Max(TOTAL &amp;lt;Campaign, [MonthYear Prise RDV]&amp;gt; Aggr(Max([Date Prise RDV]) + 90, Campaign, [MonthYear Prise RDV], RDV_ID, Date_Key)), 1, 0), Campaign, [MonthYear Prise RDV], RDV_ID))&lt;/PRE&gt;&lt;P&gt;Where&amp;nbsp;[MonthYear Prise RDV] is created in the script like this&lt;/P&gt;&lt;PRE&gt;LOAD Campaign, 
     [Date Prise RDV], 
     PER_Code,
	 Date#(Year([Date Prise RDV]) &amp;amp; '-' &amp;amp; Month([Date Prise RDV]), 'YYYY-MMM') as [MonthYear Prise RDV]
FROM
[C:\Users\cbe\Desktop\QV Eks\Campaign.xlsx]
(ooxml, embedded labels)
Where Campaign = 'PF : campagne suspects MDN1'
;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Jan 2019 20:05:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Max-Date-Set-Analysis/m-p/1536772#M746162</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-01-29T20:05:59Z</dc:date>
    </item>
    <item>
      <title>Re: Max Date, Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Max-Date-Set-Analysis/m-p/1537423#M746163</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/46628"&gt;@sunny_talwar&lt;/a&gt;&amp;nbsp;you're brilliant, wow! Thank you very much. This has really helped me forward (and improve my understanding of QV). Thank you &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've added the minimum as well using your logic and I getting the right result.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;=Sum({&amp;lt;AppointmentParent={'Nouveau RDV'}&amp;gt;} Aggr(
If(Date_Key &amp;lt;= Max(TOTAL &amp;lt;Campaign, [MonthYear Prise RDV]&amp;gt; Aggr(Max([Date Prise RDV]) + 90, 
Campaign, [MonthYear Prise RDV], RDV_ID, Date_Key)),
If(Date_Key &amp;gt;= Min(TOTAL &amp;lt;Campaign, [MonthYear Prise RDV]&amp;gt; Aggr(Min([Date Prise RDV]), 
Campaign, [MonthYear Prise RDV], RDV_ID, Date_Key))
, 1, 0))
, Campaign, [MonthYear Prise RDV], RDV_ID))&lt;/PRE&gt;</description>
      <pubDate>Wed, 30 Jan 2019 18:30:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Max-Date-Set-Analysis/m-p/1537423#M746163</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-01-30T18:30:06Z</dc:date>
    </item>
  </channel>
</rss>

