<?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: Group month by last modified in time selection in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Group-month-by-last-modified-in-time-selection/m-p/1353815#M415685</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Variables missing? Date has a different format? Could be anything... difficult to say&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 07 Jun 2017 10:58:14 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2017-06-07T10:58:14Z</dc:date>
    <item>
      <title>Group month by last modified in time selection</title>
      <link>https://community.qlik.com/t5/QlikView/Group-month-by-last-modified-in-time-selection/m-p/1353809#M415679</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope somebody can help me. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In Qlik Sense I am trying to create an table to count the unique appointments per month, based on a certain selection date. I now have the issue that one appointment can be multiple times in my dataset, because the appointment (as well as the date it was planned for) can be modified.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my selection I want to show the appointment in the month it was planned for (AppointmentDate) based on the modified date (AppointmentModified).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In Qlikview I have created an simplified sample dataset; you can find it attached to this post. Below the printscreen of my flat data table.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Printscreen.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/165085_Printscreen.png" style="height: 105px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;When my selection date is November 2nd 2016 the month I would like to show is January 2017 (the month of 2-1-2017).&lt;/P&gt;&lt;P&gt;When my selection date is February 14th 2017 the month I would like to show is February 2017 (left orange square in the printscreen).&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;When my selection date is May20th 2017 the month I would like to show is May 2017 (left blue square in the printscreen).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;WHen my selection date is May 25th 2017 the month I would like to show is September 2017. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;I tried to use firstsortedvalue in combination with an aggr on my appointmentid but I don't seem to get it working.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Can anybody help or advise what to do to get this correct?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Thanks in advance for your help and answers.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 May 2017 12:32:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Group-month-by-last-modified-in-time-selection/m-p/1353809#M415679</guid>
      <dc:creator>hansNL</dc:creator>
      <dc:date>2017-05-29T12:32:23Z</dc:date>
    </item>
    <item>
      <title>Re: Group month by last modified in time selection</title>
      <link>https://community.qlik.com/t5/QlikView/Group-month-by-last-modified-in-time-selection/m-p/1353810#M415680</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe &lt;A href="https://community.qlik.com/qlik-users/171708"&gt;stalwar1&lt;/A&gt; could help you out, seen several posts of him regarding the use of firstsorted value&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 May 2017 18:56:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Group-month-by-last-modified-in-time-selection/m-p/1353810#M415680</guid>
      <dc:creator>p_verkooijen</dc:creator>
      <dc:date>2017-05-30T18:56:01Z</dc:date>
    </item>
    <item>
      <title>Re: Group month by last modified in time selection</title>
      <link>https://community.qlik.com/t5/QlikView/Group-month-by-last-modified-in-time-selection/m-p/1353811#M415681</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One way would be to use something like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=Sum(Aggr(If(Max(TOTAL &amp;lt;AppointmentID&amp;gt; If(AppointmentModifiedDT &amp;lt; vSelectionDate, YearMonth, 0)) = YearMonth, 1, 0), AppointmentID, AppointmentModifiedDT, AppointmentCreatedDT))&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 May 2017 19:16:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Group-month-by-last-modified-in-time-selection/m-p/1353811#M415681</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-05-30T19:16:09Z</dc:date>
    </item>
    <item>
      <title>Re: Group month by last modified in time selection</title>
      <link>https://community.qlik.com/t5/QlikView/Group-month-by-last-modified-in-time-selection/m-p/1353812#M415682</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A href="https://community.qlik.com/qlik-users/171708"&gt;stalwar1&lt;/A&gt;‌,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your reply. When I opened the file I thought this would be a working solution but when I added this into my report it unfortunately does not work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my file I have now 2 issues:&lt;/P&gt;&lt;P&gt;- There are appointments counted more than once. The filter on appointmentID 214227|42872|7 shows an appointment which is counted 16 times.&lt;/P&gt;&lt;P&gt;- The calculation is quite slow with the number of records which are in.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;That's why I now created a new document including more example records. The file is attached. When you remove the filter you can see the reporting as it is now. In the row Sunny Calculation I added your calculation including some nescessary set analysis.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope you can advise how to solve this.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 May 2017 15:03:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Group-month-by-last-modified-in-time-selection/m-p/1353812#M415682</guid>
      <dc:creator>hansNL</dc:creator>
      <dc:date>2017-05-31T15:03:22Z</dc:date>
    </item>
    <item>
      <title>Re: Group month by last modified in time selection</title>
      <link>https://community.qlik.com/t5/QlikView/Group-month-by-last-modified-in-time-selection/m-p/1353813#M415683</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For number 1, I have not tested it with the complete dataset (not sure what the desired output is), but with the particular appointment id, this seems to be working&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=&lt;SPAN style="color: #ff0000;"&gt;Count&lt;/SPAN&gt;(&lt;SPAN style="color: #ff0000;"&gt;DISTINCT&lt;/SPAN&gt; {&amp;lt;FactType={'AP'}, Date={"&amp;gt;=$(vSelectionDate)&amp;lt;$(vSelectionDateNY)"}, AppointmentCreatedDate={"&amp;lt;=$(vSelectionDate)"}, AppointmentDeletedDate={"&amp;gt;$(vSelectionDate)"}&amp;gt;}&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Aggr(&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;If(Max({&amp;lt;FactType={'AP'}, Date={"&amp;gt;=$(vSelectionDate)&amp;lt;$(vSelectionDateNY)"}, AppointmentCreatedDate={"&amp;lt;=$(vSelectionDate)"}, AppointmentDeletedDate={"&amp;gt;$(vSelectionDate)"}&amp;gt;} TOTAL &amp;lt;AppointmentID&amp;gt; If(AppointmentModifiedDateTime &amp;lt; vSelectionDate, Month, 0)) = Month, &lt;SPAN style="color: #ff0000;"&gt;AppointmentID&lt;/SPAN&gt;, 0), AppointmentID, AppointmentModifiedDateTime, AppointmentCreatedDate))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With regards to the slowness, I think there is barely anything you can do about it. One possibility is to create a new field in the script with &lt;STRONG style="font-size: 13.3333px;"&gt;AppointmentID&amp;amp;&lt;STRONG style="font-size: 13.3333px;"&gt;AppointmentModifiedDateTime&amp;amp;&lt;STRONG style="font-size: 13.3333px;"&gt;AppointmentCreatedDate &lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;and then try with some sort of set analysis.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But see if the above expression works the way you would expect for the whole dataset? If it does, then we will worry about the performance part.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 May 2017 15:34:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Group-month-by-last-modified-in-time-selection/m-p/1353813#M415683</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-05-31T15:34:29Z</dc:date>
    </item>
    <item>
      <title>Re: Group month by last modified in time selection</title>
      <link>https://community.qlik.com/t5/QlikView/Group-month-by-last-modified-in-time-selection/m-p/1353814#M415684</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sunny,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is going into the right direction. I found some issues in the data as well so these I am cleaning up first before checking further if the formula calculates the correct result. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I also have to figure out is why your formula does not give any results when I paste it into my Sense app. I guess this has to do with other rows in the same fact table. When I paste it in an Sense app with only this dataset does work. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jun 2017 07:14:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Group-month-by-last-modified-in-time-selection/m-p/1353814#M415684</guid>
      <dc:creator>hansNL</dc:creator>
      <dc:date>2017-06-07T07:14:26Z</dc:date>
    </item>
    <item>
      <title>Re: Group month by last modified in time selection</title>
      <link>https://community.qlik.com/t5/QlikView/Group-month-by-last-modified-in-time-selection/m-p/1353815#M415685</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Variables missing? Date has a different format? Could be anything... difficult to say&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jun 2017 10:58:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Group-month-by-last-modified-in-time-selection/m-p/1353815#M415685</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-06-07T10:58:14Z</dc:date>
    </item>
    <item>
      <title>Re: Group month by last modified in time selection</title>
      <link>https://community.qlik.com/t5/QlikView/Group-month-by-last-modified-in-time-selection/m-p/1353816#M415686</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sunny,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I just found out what the issue is and my assumption was correct. As soon as I select 'AP' (appointment) in the field FactType your calculation works. With this selection I only select the rows with valid data regarding the appointments.&lt;/P&gt;&lt;P&gt;It looks like the calculation cannot handle other non-appointment related data in the same fact table. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nevertheless; even with this selection in place the calculation takes way to long; about 3 minutes. As soon as I change the selectiondate the new calculation again takes 3 minutes. So this is not acceptable for the end-users. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope you can advise on:&lt;/P&gt;&lt;P&gt;1. How to change the calculation so the other none-appointment related fact rows don't impact the calculation&lt;/P&gt;&lt;P&gt;2. How to improve calculation performance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jun 2017 12:32:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Group-month-by-last-modified-in-time-selection/m-p/1353816#M415686</guid>
      <dc:creator>hansNL</dc:creator>
      <dc:date>2017-06-07T12:32:20Z</dc:date>
    </item>
    <item>
      <title>Re: Group month by last modified in time selection</title>
      <link>https://community.qlik.com/t5/QlikView/Group-month-by-last-modified-in-time-selection/m-p/1353817#M415687</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;1) You will have to share this none-appointment example where this isn't working. It would be difficult to figure out for me without knowing your data&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) I did propose the use of set analysis, but will have to played around with it. I think I will wait for your response on the first thing and then work on both the things at the same time&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jun 2017 12:55:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Group-month-by-last-modified-in-time-selection/m-p/1353817#M415687</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-06-07T12:55:11Z</dc:date>
    </item>
    <item>
      <title>Re: Group month by last modified in time selection</title>
      <link>https://community.qlik.com/t5/QlikView/Group-month-by-last-modified-in-time-selection/m-p/1353818#M415688</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13.3333px;"&gt;Hi Sunny,&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;thanks for your help. I have spend some time on it but I am not able to find out which records are causing the issue that it won't work without selecting the Fact Type appointment. Because of this I cannot upload an example of this issue.&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;I have the idea that we / I was thinking to difficult so that's why I went back to the basics again.&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Now I have created a new basic Qlikview document with another way of calculating it.&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;In the load script I have now created an field with an appointment ID ("AfsprRecId")&amp;nbsp; containing the id of the appointment and the record number of the appointment. So the first record for the appointment has as last digit a 1 and for each line where the appointment was modified the last number is + 1.&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;I have created an variable "vTest" which concats all the (for the current selection valid) maximum AfsprRecID's . &lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;In the table I now do an distinct count of the appointments where the id exists in the variable.&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;This works in my test and also in my production app. The only issue is that the calculation time in my production app takes way, way to long.&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Hopefully you can help me with integrating my variable into the set analysis directly.&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Thanks for your help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Jun 2017 13:57:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Group-month-by-last-modified-in-time-selection/m-p/1353818#M415688</guid>
      <dc:creator>hansNL</dc:creator>
      <dc:date>2017-06-21T13:57:07Z</dc:date>
    </item>
  </channel>
</rss>

