<?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 Comparison of equivalent periods in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Comparison-of-equivalent-periods/m-p/1734748#M56125</link>
    <description>&lt;P&gt;Dear experts,&lt;BR /&gt;First of all, I apologize if my grammar is not ideal, I am Argentine and I am using the google translator to write the query.&lt;BR /&gt;I work in a health company transporting patients, and I have to make a comparison between the services performed between the previous month and the current one, taking into account the beginning of the month, the date selected in the current month and the beginning of the previous month and the date equivalent to the one selected but from the previous month. That part I could solve this way.&lt;/P&gt;&lt;P&gt;Measurement that counts the services until the selected date:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;count ({&amp;lt;Product = {"Emergency"}, CalledDate = {"&amp;gt; = $ (= max (Date (MonthStart (CalledDate)), 'DD / MM / YYYY')) &amp;lt;= $ (= max (Date (CalledDate) , 'DD / MM / YYYY'))) "}&amp;gt;} IncidentNumber)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Measure that counts the services up to the same date but the previous month:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;count ({&amp;lt;Product = {"Emergency"}, CalledDate = {"&amp;gt; = $ (= max (Date (MonthStart (AddMonths (CalledDate, -1))), 'DD / MM / YYYY')) &amp;lt;= $ ( = max (Date (AddMonths (CalledDate, -1), 'DD / MM / YYYY'))) "}&amp;gt;} IncidentNumber)&lt;/FONT&gt;&lt;/P&gt;&lt;DIV class="tlid-input input"&gt;&lt;DIV class="source-wrap"&gt;&lt;DIV class="input-full-height-wrapper tlid-input-full-height-wrapper"&gt;&lt;DIV class="source-input"&gt;&lt;DIV class="source-footer-wrap source-or-target-footer"&gt;&lt;DIV class="character-count tlid-character-count"&gt;&lt;DIV class="cc-ctr normal"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class="source-footer"&gt;&lt;DIV class="speech-wrap source-or-target-footer-button left-positioned"&gt;&lt;DIV class="speech-button goog-toolbar-button"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class="src-tts left-positioned ttsbutton jfk-button-flat source-or-target-footer-button jfk-button"&gt;&lt;DIV class="jfk-button-img"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class="tlid-results-container results-container"&gt;&lt;DIV class="tlid-result result-dict-wrapper"&gt;&lt;DIV class="result tlid-copy-target"&gt;&lt;DIV class="result-header"&gt;&lt;DIV class="starbutton jfk-button-flat jfk-button unstarred"&gt;&lt;DIV class="jfk-button-img"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class="text-wrap tlid-copy-target"&gt;&lt;DIV class="result-shield-container tlid-copy-target"&gt;&lt;SPAN class="tlid-translation translation"&gt;&lt;SPAN&gt;My problem has to do with the end of the month.&lt;/SPAN&gt; &lt;SPAN&gt;since if I am on the 30th and the previous month has 31 days, I lose that last day in the analysis.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class=""&gt;So I am trying to do that if the selected day corresponds to the end of the month, it takes me all the days of the previous month.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;BR /&gt;I have been trying to do this with no results.&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;count ({&amp;lt;Product = {"Emergency"}, CalledDate = {$ (= "if (FLOOR (date (GetFieldSelections (CalledDate), 'DD / MM / YYYY')) = FLOOR (date (MonthEnd (GetFieldSelections (CalledDate) ), 'DD / MM / YYYY')),&amp;gt; = max (Date (MonthStart (AddMonths (CalledDate, -1))), 'DD / MM / YYYY') &amp;lt;= max (Date (MonthEnd (AddMonths (CalledDate, -1), 'DD / MM / YYYY'))),&amp;gt; = max (Date (MonthStart (AddMonths (CalledDate, -1))), 'DD / MM / YYYY')) &amp;lt;= max (Date (AddMonths ( CalledDate, -1), 'DD / MM / YYYY')) ")}&amp;gt;} IncidentNumber)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;But this would not be working correctly, since it does not bring me any value.&lt;BR /&gt;I appreciate any help you can offer me to solve it&lt;/P&gt;</description>
    <pubDate>Sat, 16 Nov 2024 01:42:22 GMT</pubDate>
    <dc:creator>HunterWatts</dc:creator>
    <dc:date>2024-11-16T01:42:22Z</dc:date>
    <item>
      <title>Comparison of equivalent periods</title>
      <link>https://community.qlik.com/t5/App-Development/Comparison-of-equivalent-periods/m-p/1734748#M56125</link>
      <description>&lt;P&gt;Dear experts,&lt;BR /&gt;First of all, I apologize if my grammar is not ideal, I am Argentine and I am using the google translator to write the query.&lt;BR /&gt;I work in a health company transporting patients, and I have to make a comparison between the services performed between the previous month and the current one, taking into account the beginning of the month, the date selected in the current month and the beginning of the previous month and the date equivalent to the one selected but from the previous month. That part I could solve this way.&lt;/P&gt;&lt;P&gt;Measurement that counts the services until the selected date:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;count ({&amp;lt;Product = {"Emergency"}, CalledDate = {"&amp;gt; = $ (= max (Date (MonthStart (CalledDate)), 'DD / MM / YYYY')) &amp;lt;= $ (= max (Date (CalledDate) , 'DD / MM / YYYY'))) "}&amp;gt;} IncidentNumber)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Measure that counts the services up to the same date but the previous month:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;count ({&amp;lt;Product = {"Emergency"}, CalledDate = {"&amp;gt; = $ (= max (Date (MonthStart (AddMonths (CalledDate, -1))), 'DD / MM / YYYY')) &amp;lt;= $ ( = max (Date (AddMonths (CalledDate, -1), 'DD / MM / YYYY'))) "}&amp;gt;} IncidentNumber)&lt;/FONT&gt;&lt;/P&gt;&lt;DIV class="tlid-input input"&gt;&lt;DIV class="source-wrap"&gt;&lt;DIV class="input-full-height-wrapper tlid-input-full-height-wrapper"&gt;&lt;DIV class="source-input"&gt;&lt;DIV class="source-footer-wrap source-or-target-footer"&gt;&lt;DIV class="character-count tlid-character-count"&gt;&lt;DIV class="cc-ctr normal"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class="source-footer"&gt;&lt;DIV class="speech-wrap source-or-target-footer-button left-positioned"&gt;&lt;DIV class="speech-button goog-toolbar-button"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class="src-tts left-positioned ttsbutton jfk-button-flat source-or-target-footer-button jfk-button"&gt;&lt;DIV class="jfk-button-img"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class="tlid-results-container results-container"&gt;&lt;DIV class="tlid-result result-dict-wrapper"&gt;&lt;DIV class="result tlid-copy-target"&gt;&lt;DIV class="result-header"&gt;&lt;DIV class="starbutton jfk-button-flat jfk-button unstarred"&gt;&lt;DIV class="jfk-button-img"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class="text-wrap tlid-copy-target"&gt;&lt;DIV class="result-shield-container tlid-copy-target"&gt;&lt;SPAN class="tlid-translation translation"&gt;&lt;SPAN&gt;My problem has to do with the end of the month.&lt;/SPAN&gt; &lt;SPAN&gt;since if I am on the 30th and the previous month has 31 days, I lose that last day in the analysis.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class=""&gt;So I am trying to do that if the selected day corresponds to the end of the month, it takes me all the days of the previous month.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;BR /&gt;I have been trying to do this with no results.&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;count ({&amp;lt;Product = {"Emergency"}, CalledDate = {$ (= "if (FLOOR (date (GetFieldSelections (CalledDate), 'DD / MM / YYYY')) = FLOOR (date (MonthEnd (GetFieldSelections (CalledDate) ), 'DD / MM / YYYY')),&amp;gt; = max (Date (MonthStart (AddMonths (CalledDate, -1))), 'DD / MM / YYYY') &amp;lt;= max (Date (MonthEnd (AddMonths (CalledDate, -1), 'DD / MM / YYYY'))),&amp;gt; = max (Date (MonthStart (AddMonths (CalledDate, -1))), 'DD / MM / YYYY')) &amp;lt;= max (Date (AddMonths ( CalledDate, -1), 'DD / MM / YYYY')) ")}&amp;gt;} IncidentNumber)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;But this would not be working correctly, since it does not bring me any value.&lt;BR /&gt;I appreciate any help you can offer me to solve it&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 01:42:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Comparison-of-equivalent-periods/m-p/1734748#M56125</guid>
      <dc:creator>HunterWatts</dc:creator>
      <dc:date>2024-11-16T01:42:22Z</dc:date>
    </item>
    <item>
      <title>Re: Comparison of equivalent periods</title>
      <link>https://community.qlik.com/t5/App-Development/Comparison-of-equivalent-periods/m-p/1734768#M56131</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Count({&amp;lt;Product = {"Emergency"}, CalledDate = {"&amp;gt;=$(=Date(MonthStart(Max(CalledDate), -1), 'DD/MM/YYYY'))&amp;lt;=$(=Date(If(Day(Max(CalledDate)) = Day(MonthEnd(Max(CalledDate))), Floor(MonthEnd(Max(CalledDate), -1)), AddMonths(Max(CalledDate), -1)), 'DD/MM/YYYY'))"}&amp;gt;} IncidentNumber)&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 11 Aug 2020 11:12:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Comparison-of-equivalent-periods/m-p/1734768#M56131</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2020-08-11T11:12:24Z</dc:date>
    </item>
    <item>
      <title>Re: Comparison of equivalent periods</title>
      <link>https://community.qlik.com/t5/App-Development/Comparison-of-equivalent-periods/m-p/1734781#M56132</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Thank you very much for answering, This solves a part, but I need to put it in an if inside a setanalysis so that when for example I select April 30, it will calculate until March 31, but if I select any date that does not coincide with the end of the month, it will calculate until the same day of the previous month.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Aug 2020 11:32:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Comparison-of-equivalent-periods/m-p/1734781#M56132</guid>
      <dc:creator>HunterWatts</dc:creator>
      <dc:date>2020-08-11T11:32:00Z</dc:date>
    </item>
    <item>
      <title>Re: Comparison of equivalent periods</title>
      <link>https://community.qlik.com/t5/App-Development/Comparison-of-equivalent-periods/m-p/1734796#M56136</link>
      <description>&lt;P&gt;Right and that is what the expression should do... isn't that is what it is doing?&lt;/P&gt;</description>
      <pubDate>Tue, 11 Aug 2020 12:21:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Comparison-of-equivalent-periods/m-p/1734796#M56136</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2020-08-11T12:21:48Z</dc:date>
    </item>
    <item>
      <title>Re: Comparison of equivalent periods</title>
      <link>https://community.qlik.com/t5/App-Development/Comparison-of-equivalent-periods/m-p/1734823#M56142</link>
      <description>&lt;P&gt;You're right, I hadn't seen well. It works perfectly. Thank you very much.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Aug 2020 13:00:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Comparison-of-equivalent-periods/m-p/1734823#M56142</guid>
      <dc:creator>HunterWatts</dc:creator>
      <dc:date>2020-08-11T13:00:25Z</dc:date>
    </item>
  </channel>
</rss>

