<?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: Rango de meses anteriores con la ayuda del set analysis in Visualization and Usability</title>
    <link>https://community.qlik.com/t5/Visualization-and-Usability/Rango-de-meses-anteriores-con-la-ayuda-del-set-analysis/m-p/2428789#M248024</link>
    <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/113260"&gt;@melperso21&lt;/a&gt;&amp;nbsp;If you have a date in the format 'MMM YYYY', the approach will not work even if we cast the dates to be in that format.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;For example, we could code something like this where we format the date as 'MMM YYYY'&lt;BR /&gt;&lt;BR /&gt;count({$&amp;lt;event.montFDate={"&amp;gt;=$(=date(addmonths(max(date#(event.montFDate,'MMM YYYY')),-14),'MMM YYYY'))&amp;lt;=$(=date(addmonths(max(date#(event.montFDate,'MMM YYYY')),-12),'MMM YYYY'))"}&amp;gt;}distinct order_id)&lt;/P&gt;
&lt;P&gt;But this will resolve to&lt;/P&gt;
&lt;P&gt;count({&amp;lt;event.montFDate={"&amp;gt;=Dec 2021&amp;lt;=Feb 2022"}&amp;gt;}distinct order_id)&lt;BR /&gt;&lt;BR /&gt;This will not work because the greater than and less than will treat the date in alphanumerical order.&lt;BR /&gt;&lt;BR /&gt;The best way to do this is to first convert event.montFDate to a date using&amp;nbsp;date(date#([event.montFDate],'MMM YYYY'),'YYYYMMDD')&lt;/P&gt;
&lt;P&gt;Then apply the original expression.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE class="lia-code-sample  language-python"&gt;&lt;CODE&gt;count({$&amp;lt;event.montFDate={"&amp;gt;=$(=addmonths(max(event.montFDate),-14))&amp;lt;=$(=addmonths(max(event.montFDate),-12))"}&amp;gt;}distinct order_id)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope this helps&lt;/P&gt;</description>
    <pubDate>Fri, 08 Mar 2024 15:05:51 GMT</pubDate>
    <dc:creator>pravinboniface</dc:creator>
    <dc:date>2024-03-08T15:05:51Z</dc:date>
    <item>
      <title>Rango de meses anteriores con la ayuda del set analysis</title>
      <link>https://community.qlik.com/t5/Visualization-and-Usability/Rango-de-meses-anteriores-con-la-ayuda-del-set-analysis/m-p/2423780#M247224</link>
      <description>&lt;P&gt;Hola Comunidad, necesito su ayuda, estoy aplicando un código con set analysis, con el objetivo de escoger una fecha y luego seleccionar el mismo mes de hace un año atras, para esto estoy usando el siguiente código:&amp;nbsp;count({$&amp;lt;event.montFDate={"$(=monthname(max(event.montFDateP),-12))"}&amp;gt;}distinct(order_id))&lt;/P&gt;
&lt;P&gt;Ahora necesito aplicar una misma lógica, pero lograr obtener el total del mes de hace un año atras y los dos meses anteriores, es decir, si escojo ahorita el mes de enero del 2024, esta lógica logre tener la suma de enero/2023, diciembre/2022 y noviembre del 2022&lt;BR /&gt;&lt;BR /&gt;Espero que mi duda quede clara y poder tener ayuda de ustedes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Saludos.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Feb 2024 22:13:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Visualization-and-Usability/Rango-de-meses-anteriores-con-la-ayuda-del-set-analysis/m-p/2423780#M247224</guid>
      <dc:creator>melperso21</dc:creator>
      <dc:date>2024-02-26T22:13:27Z</dc:date>
    </item>
    <item>
      <title>Re: Rango de meses anteriores con la ayuda del set analysis</title>
      <link>https://community.qlik.com/t5/Visualization-and-Usability/Rango-de-meses-anteriores-con-la-ayuda-del-set-analysis/m-p/2423843#M247234</link>
      <description>&lt;P&gt;Please try this:&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;count({$&amp;lt;event.montFDate={"&amp;gt;=$(=addmonths(max(event.montFDate),-14))&amp;lt;=$(=addmonths(max(event.montFDate),-12))"}&amp;gt;}distinct order_id)&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 27 Feb 2024 04:15:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Visualization-and-Usability/Rango-de-meses-anteriores-con-la-ayuda-del-set-analysis/m-p/2423843#M247234</guid>
      <dc:creator>pravinboniface</dc:creator>
      <dc:date>2024-02-27T04:15:46Z</dc:date>
    </item>
    <item>
      <title>Re: Rango de meses anteriores con la ayuda del set analysis</title>
      <link>https://community.qlik.com/t5/Visualization-and-Usability/Rango-de-meses-anteriores-con-la-ayuda-del-set-analysis/m-p/2424201#M247275</link>
      <description>&lt;P&gt;Hola&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/259414"&gt;@pravinboniface&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Probe, pero me da valor 0&lt;/P&gt;</description>
      <pubDate>Tue, 27 Feb 2024 15:30:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Visualization-and-Usability/Rango-de-meses-anteriores-con-la-ayuda-del-set-analysis/m-p/2424201#M247275</guid>
      <dc:creator>melperso21</dc:creator>
      <dc:date>2024-02-27T15:30:16Z</dc:date>
    </item>
    <item>
      <title>Re: Rango de meses anteriores con la ayuda del set analysis</title>
      <link>https://community.qlik.com/t5/Visualization-and-Usability/Rango-de-meses-anteriores-con-la-ayuda-del-set-analysis/m-p/2424297#M247291</link>
      <description>&lt;P&gt;Can you please share the format of&amp;nbsp;&lt;SPAN&gt;event.montFDate?&amp;nbsp; I think there may be a date format mismatch with what I tried.&amp;nbsp; I tested with data looking as follows&lt;BR /&gt;&lt;BR /&gt;load * inline [&lt;BR /&gt;event.montFDate,order_id&lt;BR /&gt;1/1/2023,1&lt;BR /&gt;2/1/2023,2&lt;BR /&gt;];&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Feb 2024 20:26:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Visualization-and-Usability/Rango-de-meses-anteriores-con-la-ayuda-del-set-analysis/m-p/2424297#M247291</guid>
      <dc:creator>pravinboniface</dc:creator>
      <dc:date>2024-02-27T20:26:28Z</dc:date>
    </item>
    <item>
      <title>Re: Rango de meses anteriores con la ayuda del set analysis</title>
      <link>https://community.qlik.com/t5/Visualization-and-Usability/Rango-de-meses-anteriores-con-la-ayuda-del-set-analysis/m-p/2428727#M248014</link>
      <description>&lt;P&gt;Hola&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/259414"&gt;@pravinboniface&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;El formato que uso es el siguiente:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="melperso21_0-1709901691910.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/161596i3B96977D5FF747EE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="melperso21_0-1709901691910.png" alt="melperso21_0-1709901691910.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Saludos.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Mar 2024 12:41:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Visualization-and-Usability/Rango-de-meses-anteriores-con-la-ayuda-del-set-analysis/m-p/2428727#M248014</guid>
      <dc:creator>melperso21</dc:creator>
      <dc:date>2024-03-08T12:41:46Z</dc:date>
    </item>
    <item>
      <title>Re: Rango de meses anteriores con la ayuda del set analysis</title>
      <link>https://community.qlik.com/t5/Visualization-and-Usability/Rango-de-meses-anteriores-con-la-ayuda-del-set-analysis/m-p/2428789#M248024</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/113260"&gt;@melperso21&lt;/a&gt;&amp;nbsp;If you have a date in the format 'MMM YYYY', the approach will not work even if we cast the dates to be in that format.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;For example, we could code something like this where we format the date as 'MMM YYYY'&lt;BR /&gt;&lt;BR /&gt;count({$&amp;lt;event.montFDate={"&amp;gt;=$(=date(addmonths(max(date#(event.montFDate,'MMM YYYY')),-14),'MMM YYYY'))&amp;lt;=$(=date(addmonths(max(date#(event.montFDate,'MMM YYYY')),-12),'MMM YYYY'))"}&amp;gt;}distinct order_id)&lt;/P&gt;
&lt;P&gt;But this will resolve to&lt;/P&gt;
&lt;P&gt;count({&amp;lt;event.montFDate={"&amp;gt;=Dec 2021&amp;lt;=Feb 2022"}&amp;gt;}distinct order_id)&lt;BR /&gt;&lt;BR /&gt;This will not work because the greater than and less than will treat the date in alphanumerical order.&lt;BR /&gt;&lt;BR /&gt;The best way to do this is to first convert event.montFDate to a date using&amp;nbsp;date(date#([event.montFDate],'MMM YYYY'),'YYYYMMDD')&lt;/P&gt;
&lt;P&gt;Then apply the original expression.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE class="lia-code-sample  language-python"&gt;&lt;CODE&gt;count({$&amp;lt;event.montFDate={"&amp;gt;=$(=addmonths(max(event.montFDate),-14))&amp;lt;=$(=addmonths(max(event.montFDate),-12))"}&amp;gt;}distinct order_id)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope this helps&lt;/P&gt;</description>
      <pubDate>Fri, 08 Mar 2024 15:05:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Visualization-and-Usability/Rango-de-meses-anteriores-con-la-ayuda-del-set-analysis/m-p/2428789#M248024</guid>
      <dc:creator>pravinboniface</dc:creator>
      <dc:date>2024-03-08T15:05:51Z</dc:date>
    </item>
  </channel>
</rss>

