<?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: Auto Calculate KPI for Max Date with updated data in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Auto-Calculate-KPI-for-Max-Date-with-updated-data/m-p/1662553#M49762</link>
    <description>&lt;P&gt;I forgot to add, I would like to count based on each Status as well and then one KPI which does not depend on Status.&lt;/P&gt;&lt;P&gt;Count({&amp;lt;Period={'2020-01'}&amp;gt;} [ID]) gets me the total count for that Period, but it is not dynamic. I tried to use MaxString(Period), but I was receiving a&amp;nbsp;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;Nested Aggregation Not Allowed" error.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Count({&amp;lt;Status={'RED'},Period={'2019-12'}&amp;gt;} [ID]) gets me the the total count for the Status = 'RED', but the Period is not dynamic still.&amp;nbsp;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Here is some pseudo code.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Count ID if MaxString(Period) and Status is 'RED'.&lt;/P&gt;&lt;P&gt;Count ID if MaxString(Period) and Status is 'ORANGE'.&lt;/P&gt;&lt;P&gt;Count ID if ID is in Previous Period, but NOT MaxString(Period).&lt;/P&gt;&lt;P&gt;Count ID if ID is in MaxString(Period), but NOT Previous Period.&lt;/P&gt;&lt;P&gt;Count ID if MaxString(Period).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 03 Jan 2020 18:55:11 GMT</pubDate>
    <dc:creator>mskusace</dc:creator>
    <dc:date>2020-01-03T18:55:11Z</dc:date>
    <item>
      <title>Auto Calculate KPI for Max Date with updated data</title>
      <link>https://community.qlik.com/t5/App-Development/Auto-Calculate-KPI-for-Max-Date-with-updated-data/m-p/1662535#M49758</link>
      <description>&lt;P&gt;I have a data set with multiple columns over multiple periods. A truncated version of the data set is below.&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG&gt;ID&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;Department&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;Status&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;Period&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;WW-B1&lt;/TD&gt;&lt;TD&gt;Sales&lt;/TD&gt;&lt;TD&gt;RED&lt;/TD&gt;&lt;TD&gt;2020-01&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;AZ-D4&lt;/TD&gt;&lt;TD&gt;Marketing&lt;/TD&gt;&lt;TD&gt;ORANGE&lt;/TD&gt;&lt;TD&gt;2019-12&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;OD-44&lt;/TD&gt;&lt;TD&gt;Operations&lt;/TD&gt;&lt;TD&gt;RED&lt;/TD&gt;&lt;TD&gt;2020-01&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;LR-UQ&lt;/TD&gt;&lt;TD&gt;Sales&lt;/TD&gt;&lt;TD&gt;ORANGE&lt;/TD&gt;&lt;TD&gt;2019-12&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;AZ-D4&lt;/TD&gt;&lt;TD&gt;Marketing&lt;/TD&gt;&lt;TD&gt;RED&lt;/TD&gt;&lt;TD&gt;2020-01&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;WW-B1&lt;/TD&gt;&lt;TD&gt;Sales&lt;/TD&gt;&lt;TD&gt;ORANGE&lt;/TD&gt;&lt;TD&gt;2019-12&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want a KPI metric to calculate the count for each status for the most RECENT period (2020-01 in this case). I will continuously add new data each month. I also want to know the number of IDs that exist in the PREVIOUS Period, but not the most RECENT period. Lastly, I want to know the number of IDs that exist in the most RECENT period, but not in the PREVIOUS period.&lt;/P&gt;&lt;P&gt;KPI Red - 3 (only for 2020-01 in this case, but will change when next month's data is loaded)&lt;/P&gt;&lt;P&gt;KPI Orange - 0 (same as above)&lt;/P&gt;&lt;P&gt;KPI Previous - 1 (ID LR-UQ exists in Period 2019-12, but not in Period 2020-01)&lt;/P&gt;&lt;P&gt;KPI Current - 1 (ID&amp;nbsp;OD-44 exists in Period 2020-01, but not in Period 2019-12)&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 03:40:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Auto-Calculate-KPI-for-Max-Date-with-updated-data/m-p/1662535#M49758</guid>
      <dc:creator>mskusace</dc:creator>
      <dc:date>2024-11-16T03:40:54Z</dc:date>
    </item>
    <item>
      <title>Re: Auto Calculate KPI for Max Date with updated data</title>
      <link>https://community.qlik.com/t5/App-Development/Auto-Calculate-KPI-for-Max-Date-with-updated-data/m-p/1662553#M49762</link>
      <description>&lt;P&gt;I forgot to add, I would like to count based on each Status as well and then one KPI which does not depend on Status.&lt;/P&gt;&lt;P&gt;Count({&amp;lt;Period={'2020-01'}&amp;gt;} [ID]) gets me the total count for that Period, but it is not dynamic. I tried to use MaxString(Period), but I was receiving a&amp;nbsp;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;Nested Aggregation Not Allowed" error.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Count({&amp;lt;Status={'RED'},Period={'2019-12'}&amp;gt;} [ID]) gets me the the total count for the Status = 'RED', but the Period is not dynamic still.&amp;nbsp;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Here is some pseudo code.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Count ID if MaxString(Period) and Status is 'RED'.&lt;/P&gt;&lt;P&gt;Count ID if MaxString(Period) and Status is 'ORANGE'.&lt;/P&gt;&lt;P&gt;Count ID if ID is in Previous Period, but NOT MaxString(Period).&lt;/P&gt;&lt;P&gt;Count ID if ID is in MaxString(Period), but NOT Previous Period.&lt;/P&gt;&lt;P&gt;Count ID if MaxString(Period).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jan 2020 18:55:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Auto-Calculate-KPI-for-Max-Date-with-updated-data/m-p/1662553#M49762</guid>
      <dc:creator>mskusace</dc:creator>
      <dc:date>2020-01-03T18:55:11Z</dc:date>
    </item>
    <item>
      <title>Re: Auto Calculate KPI for Max Date with updated data</title>
      <link>https://community.qlik.com/t5/App-Development/Auto-Calculate-KPI-for-Max-Date-with-updated-data/m-p/1662556#M49764</link>
      <description>&lt;P&gt;Your Period is text, you need to convert it into proper Date format&amp;nbsp; for expression to work dynamically&lt;/P&gt;&lt;P&gt;Data:&lt;BR /&gt;LOAD&lt;BR /&gt;ID,&lt;BR /&gt;Department,&lt;BR /&gt;Status,&lt;BR /&gt;date(Date#(Period,'YYYY-MM')) as Period&lt;BR /&gt;FROM [lib://Qlik web]&lt;BR /&gt;(html, utf8, embedded labels, table is @1);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Count({&amp;lt;Period={"$(=max(Period))"}&amp;gt;} [ID])&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jan 2020 19:00:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Auto-Calculate-KPI-for-Max-Date-with-updated-data/m-p/1662556#M49764</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2020-01-03T19:00:36Z</dc:date>
    </item>
    <item>
      <title>Re: Auto Calculate KPI for Max Date with updated data</title>
      <link>https://community.qlik.com/t5/App-Development/Auto-Calculate-KPI-for-Max-Date-with-updated-data/m-p/1662564#M49766</link>
      <description>&lt;P&gt;I have a field called ReportDate which is a timestamp value of when the report was run. If the ReportDate is "2020-01-02 00:00:00", I need the period to be the month prior so "2019-12". I tried to use Date(ReportDate, 'YYYY-MM') AS Period, but I get multiple values in my filter.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here are the values I have for the ReportDate.&lt;/P&gt;&lt;P&gt;2019-10-01 (this is just a date, not a timestamp)&lt;/P&gt;&lt;P&gt;2019-11-01 (this is just a date, not a timestamp)&lt;/P&gt;&lt;P&gt;2019-12-02 07:19:08 (this is a timestamp)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Period Filter&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Period.PNG" style="width: 262px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/26351i127DAF1335A3D566/image-size/large?v=v2&amp;amp;px=999" role="button" title="Period.PNG" alt="Period.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Report Date Filter&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ReportDate.PNG" style="width: 236px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/26352i03A5A5C60684F9AE/image-size/large?v=v2&amp;amp;px=999" role="button" title="ReportDate.PNG" alt="ReportDate.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Is there a way for me to get only the 'YYYY-MM' to show up like you have in your solution, but without the duplicates?&lt;/P&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Fri, 03 Jan 2020 19:27:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Auto-Calculate-KPI-for-Max-Date-with-updated-data/m-p/1662564#M49766</guid>
      <dc:creator>mskusace</dc:creator>
      <dc:date>2020-01-03T19:27:43Z</dc:date>
    </item>
    <item>
      <title>Re: Auto Calculate KPI for Max Date with updated data</title>
      <link>https://community.qlik.com/t5/App-Development/Auto-Calculate-KPI-for-Max-Date-with-updated-data/m-p/1662567#M49767</link>
      <description>&lt;P&gt;need to use floor function to define Month to individual date instead each timestamp&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Date(&lt;STRONG&gt;floor&lt;/STRONG&gt;(ReportDate), 'YYYY-MM')&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jan 2020 19:33:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Auto-Calculate-KPI-for-Max-Date-with-updated-data/m-p/1662567#M49767</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2020-01-03T19:33:02Z</dc:date>
    </item>
    <item>
      <title>Re: Auto Calculate KPI for Max Date with updated data</title>
      <link>https://community.qlik.com/t5/App-Development/Auto-Calculate-KPI-for-Max-Date-with-updated-data/m-p/1662568#M49768</link>
      <description>&lt;P&gt;Great! All of it seems to be working as intended. I might have some issues with the filters, but I will have to see the best way to configure it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I added to your solution since I need the Period to be 1 month less than the ReportDate.&lt;/P&gt;&lt;P&gt;Date(floor(AddMonths(ReportDate,-1)),'YYYY-MM') AS Period&lt;/P&gt;&lt;P&gt;How did the floor function resolve that when I only have one date for each month? Two of them don't have timestamps, and they have duplicate values. The one with the timestamp did not duplicate.&lt;/P&gt;&lt;P&gt;Thank you very much!&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jan 2020 19:49:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Auto-Calculate-KPI-for-Max-Date-with-updated-data/m-p/1662568#M49768</guid>
      <dc:creator>mskusace</dc:creator>
      <dc:date>2020-01-03T19:49:38Z</dc:date>
    </item>
    <item>
      <title>Re: Auto Calculate KPI for Max Date with updated data</title>
      <link>https://community.qlik.com/t5/App-Development/Auto-Calculate-KPI-for-Max-Date-with-updated-data/m-p/1662572#M49769</link>
      <description>&lt;P&gt;How can I calculate the IDs that exist in the previous Period, but not the current period? Also, those that exist in the current Period, but not the previous Period?&lt;/P&gt;&lt;P&gt;If ID exists in max(Period) - 1 month, but NOT max(Period), count the ID&lt;/P&gt;&lt;P&gt;If ID exists in max(Period), but NOT max(Period) - 1 month, count the ID&lt;/P&gt;&lt;P&gt;I would normally just limit the data set to the previous Period and the Current Period, then do a count of each ID. If previous Period and count = 1, then it's unique to the previous period.&lt;/P&gt;&lt;P&gt;If current Period and count = 1, then it's unique to the current period. I'm not sure how to implement that or if there is a better way.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jan 2020 19:57:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Auto-Calculate-KPI-for-Max-Date-with-updated-data/m-p/1662572#M49769</guid>
      <dc:creator>mskusace</dc:creator>
      <dc:date>2020-01-03T19:57:59Z</dc:date>
    </item>
  </channel>
</rss>

