<?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 Intervalos entre fechas de pedido in Español</title>
    <link>https://community.qlik.com/t5/Espa%C3%B1ol/Intervalos-entre-fechas-de-pedido/m-p/695003#M5194</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hola a todos, la cuestión es la siguiente:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tengo una tabla con tres campos:&amp;nbsp; ID_CLIENTE, ID_VENDEDOR, FECHA_PEDIDO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lo que necesito hacer es calcular, en script,&amp;nbsp; para cada vendedor qué clientes han hecho un pedido habiendo pasado un año o mas de su anterior pedido.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Aún no he encontrado una manera de calcularlo eficientemente.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;¿Me echais una manilla?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Muchas gracias&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 17 Jul 2014 07:58:48 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-07-17T07:58:48Z</dc:date>
    <item>
      <title>Intervalos entre fechas de pedido</title>
      <link>https://community.qlik.com/t5/Espa%C3%B1ol/Intervalos-entre-fechas-de-pedido/m-p/695003#M5194</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hola a todos, la cuestión es la siguiente:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tengo una tabla con tres campos:&amp;nbsp; ID_CLIENTE, ID_VENDEDOR, FECHA_PEDIDO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lo que necesito hacer es calcular, en script,&amp;nbsp; para cada vendedor qué clientes han hecho un pedido habiendo pasado un año o mas de su anterior pedido.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Aún no he encontrado una manera de calcularlo eficientemente.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;¿Me echais una manilla?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Muchas gracias&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Jul 2014 07:58:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Espa%C3%B1ol/Intervalos-entre-fechas-de-pedido/m-p/695003#M5194</guid>
      <dc:creator />
      <dc:date>2014-07-17T07:58:48Z</dc:date>
    </item>
    <item>
      <title>Re: Intervalos entre fechas de pedido</title>
      <link>https://community.qlik.com/t5/Espa%C3%B1ol/Intervalos-entre-fechas-de-pedido/m-p/695004#M5195</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hola Juan Antonio,&lt;/P&gt;&lt;P&gt;Pues se me ocurre lo siguiente:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;Pedidos_aux:&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;LOAD ...&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp; , ID_CLIENTE&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp; , ID_VENDEDOR&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp; , FECHA_PEDIDO&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp; , DayNumberOfYear(FECHA_PEDIDO) - DayNumberOfYear(Previous(FECHA_PEDIDO)) as DIAS_DISTANCIA&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;Resident Pedidos&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;Order by ID_CLIENTE, ID_VENDEDOR, FECHA_PEDIDO;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;DROP Table Pedidos;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;Pedidos:&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;LOAD *&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;Resident Pedidos_aux&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;Where DIAS_DISTANCIA &amp;gt; 365&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;DROP Table Pedidos_aux;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Evidentemente, habrá que adaptarlo a tu modelo de datos.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Un saludo y espero haberte ayudado.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Jul 2014 08:19:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Espa%C3%B1ol/Intervalos-entre-fechas-de-pedido/m-p/695004#M5195</guid>
      <dc:creator>etendero</dc:creator>
      <dc:date>2014-07-17T08:19:30Z</dc:date>
    </item>
    <item>
      <title>Re: Intervalos entre fechas de pedido</title>
      <link>https://community.qlik.com/t5/Espa%C3%B1ol/Intervalos-entre-fechas-de-pedido/m-p/695005#M5196</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hola Emilio.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Muy buena propuesta, además de resolver esta situación de una manera muy eficaz, me ha ayudado a mejorar otros cálculos.&amp;nbsp; Con estos tres campos (id_cliente, fecha_pedido, id_vendedor) la idea es calcular una serie de indicadores como:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Tasa de recuperación de cliente:&amp;nbsp; % de clientes que han hecho un pedido y hacia mas de un año que no lo hacían&lt;/P&gt;&lt;P&gt;- Tasa de perdida de clientes: % de clientes que hace mas de un año que no hacen un pedido.&lt;/P&gt;&lt;P&gt;- Tasa de adquisición: % Clientes que han realizado un cliente por primera vez&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;¿Se te ocurre como calcular la tasa de adquisición? Yo había pensado en hacer un count(fecha_pedido) para tener el total pedidos realizados, y si al restar el numero de pedidos en el periodo de análisis (mes, trimestre, etc)&amp;nbsp; y el total de pedidos realizados el resultado es 0, entonces lo consideraría cliente nuevo.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;¿Cómo lo ves?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Un saludo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Jul 2014 08:41:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Espa%C3%B1ol/Intervalos-entre-fechas-de-pedido/m-p/695005#M5196</guid>
      <dc:creator />
      <dc:date>2014-07-17T08:41:02Z</dc:date>
    </item>
    <item>
      <title>Re: Intervalos entre fechas de pedido</title>
      <link>https://community.qlik.com/t5/Espa%C3%B1ol/Intervalos-entre-fechas-de-pedido/m-p/695006#M5197</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Emilio: Me estoy dando cuenta de que al tener un histórico de pedidos de 3 años, tendría que realizar algún apaño del tipo:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; left &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;join&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; (Pedidos)&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;Load&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;FECHA_PEDIDO&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;year&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;FECHA_PEDIDO&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)= &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;year&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; (&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;today&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;()),0 ,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;year&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;FECHA_PEDIDO&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)= &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;year&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; (&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;today&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;())-1,365,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;year&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;FECHA_PEDIDO&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)= &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;year&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; (&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;today&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;())-2,730 ) )) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;AS&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;DECALAJE&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;resident&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; Pedidos;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;Pedidos_aux:&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;LOAD ...&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp; , ID_CLIENTE&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp; , ID_VENDEDOR&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp; , FECHA_PEDIDO&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp; , (DayNumberOfYear(FECHA_PEDIDO) + &lt;SPAN style="color: #800000; font-size: 8pt; text-decoration: underline;"&gt;DECALAJE&lt;/SPAN&gt;) -&amp;nbsp; (DayNumberOfYear(Previous(FECHA_PEDIDO)+&lt;SPAN style="color: #800000; font-size: 8pt; text-decoration: underline;"&gt;DECALAJE&lt;/SPAN&gt;)) as DIAS_DISTANCIA&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;Resident Pedidos&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;Order by ID_CLIENTE, ID_VENDEDOR, FECHA_PEDIDO;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;DROP Table Pedidos;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;Pedidos:&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;LOAD *&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;Resident Pedidos_aux&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;Where DIAS_DISTANCIA &amp;gt; 365&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;DROP Table Pedidos_aux;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;¿Como lo ves?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Jul 2014 08:57:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Espa%C3%B1ol/Intervalos-entre-fechas-de-pedido/m-p/695006#M5197</guid>
      <dc:creator />
      <dc:date>2014-07-17T08:57:30Z</dc:date>
    </item>
    <item>
      <title>Re: Intervalos entre fechas de pedido</title>
      <link>https://community.qlik.com/t5/Espa%C3%B1ol/Intervalos-entre-fechas-de-pedido/m-p/695007#M5198</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hola, me alegro que te haya servido.&lt;/P&gt;&lt;P&gt;Se me ocurriría algo similar a lo que planteas, siempre que te haya entendido bien. Escrito rápidamente y sin probar, para sacar el porcentaje, sería algo como:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;Count(DISTINCT if( Count(TOTAL Fecha_Pedido) = 1, ID_Cliente)&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;/&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;Count(DISTINCT ID_Cliente)&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;¿verdad?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Un saludo.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Jul 2014 09:07:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Espa%C3%B1ol/Intervalos-entre-fechas-de-pedido/m-p/695007#M5198</guid>
      <dc:creator>etendero</dc:creator>
      <dc:date>2014-07-17T09:07:34Z</dc:date>
    </item>
    <item>
      <title>Re: Intervalos entre fechas de pedido</title>
      <link>https://community.qlik.com/t5/Espa%C3%B1ol/Intervalos-entre-fechas-de-pedido/m-p/695008#M5199</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tienes razón,&lt;/P&gt;&lt;P&gt;La solución que planteas es correcta, siempre y cuando sólo tengas un histórico de 3 años como dices y que la fecha del pedido anterior no caiga en otro año.&lt;/P&gt;&lt;P&gt;Una solución para que contemple estos casos también, podía ser la siguiente:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;, (DayNumberOfYear(FECHA_PEDIDO)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; + (((Year(Today()) - Year(FECHA_PEDIDO))&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * 365))&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;- (DayNumberOfYear(Previous(FECHA_PEDIDO))&amp;nbsp; + (((Year(Today()) - Year(Previous(FECHA_PEDIDO))) * 365))&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;nbsp; as DIAS_DISTANCIA&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Un saludo.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Jul 2014 09:29:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Espa%C3%B1ol/Intervalos-entre-fechas-de-pedido/m-p/695008#M5199</guid>
      <dc:creator>etendero</dc:creator>
      <dc:date>2014-07-17T09:29:20Z</dc:date>
    </item>
    <item>
      <title>Re: Intervalos entre fechas de pedido</title>
      <link>https://community.qlik.com/t5/Espa%C3%B1ol/Intervalos-entre-fechas-de-pedido/m-p/695009#M5200</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Pensaba que al calcular el campo DECALAJE&amp;nbsp; si funcionaria, aunque me doy cuenta de que debería de calcularlo de la siguiente manera:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;left &lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;join&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; (Pedidos)&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;Load&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;FECHA_PEDIDO&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;year&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;FECHA_PEDIDO&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)= &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;year&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; (&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;today&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;()), 730 ,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;year&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;FECHA_PEDIDO&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)= &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;year&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; (&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;today&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;())-1,365,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;year&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;FECHA_PEDIDO&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)= &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;year&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; (&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;today&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;())-2, 0 ) )) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;AS&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;DECALAJE&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;resident&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; Pedidos;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Asi un pedido del 6/12/2014 tendría como dia del año ( 6 ) + decalaje ( 730 )&amp;nbsp; = 736 y un pedido del 30/12/2013&amp;nbsp; tendría como dia ( 364 ) + decalaje&amp;nbsp; ( 365 )=&amp;nbsp; 729 , siendo asi la distancia entre pedidos de 7 días, por lo que aparentemente &lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;si funciona .&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Jul 2014 09:41:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Espa%C3%B1ol/Intervalos-entre-fechas-de-pedido/m-p/695009#M5200</guid>
      <dc:creator />
      <dc:date>2014-07-17T09:41:17Z</dc:date>
    </item>
    <item>
      <title>Re: Intervalos entre fechas de pedido</title>
      <link>https://community.qlik.com/t5/Espa%C3%B1ol/Intervalos-entre-fechas-de-pedido/m-p/695010#M5201</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Pero el DECALAJE lo estás calculando sobre la FECHA_PEDIDO, entonces le vas a aplicar el mismo DECALAJE tanto a FECHA_PEDIDO como a Previous(FECHA_PEDIDO) y no uno distinto a cada uno. Tu ejemplo sería:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Asi un pedido del 6/12/2014 tendría como dia del año ( 6 ) + decalaje ( 730 ) = 736 y un pedido del 30/12/2013 tendría como dia ( 364 ) + decalaje ( &lt;SPAN style="text-decoration: line-through;"&gt;365&lt;/SPAN&gt; &lt;STRONG&gt;730&lt;/STRONG&gt; ) =&amp;nbsp; &lt;SPAN style="text-decoration: line-through;"&gt;729&lt;/SPAN&gt; &lt;STRONG&gt;1094&lt;/STRONG&gt;, siendo así la distancia entre pedidos de &lt;SPAN style="text-decoration: line-through;"&gt;7&lt;/SPAN&gt; &lt;STRONG&gt;358&lt;/STRONG&gt; días, por lo que aparentemente &lt;SPAN style="text-decoration: line-through;"&gt;si&lt;/SPAN&gt; &lt;STRONG&gt;NO&lt;/STRONG&gt; funciona.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Un saludo.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Jul 2014 10:21:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Espa%C3%B1ol/Intervalos-entre-fechas-de-pedido/m-p/695010#M5201</guid>
      <dc:creator>etendero</dc:creator>
      <dc:date>2014-07-17T10:21:14Z</dc:date>
    </item>
    <item>
      <title>Re: Intervalos entre fechas de pedido</title>
      <link>https://community.qlik.com/t5/Espa%C3%B1ol/Intervalos-entre-fechas-de-pedido/m-p/695011#M5202</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tienes Razón. No había caído en que el decalaje se aplica únicamente a la fecha del pedido. Voy a ejecutar con la solución que me indicabas. Y luego a probar el tema de la tasa de adquisición, que aun no me he metido con ello.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;gracias de nuevo.&amp;nbsp;&amp;nbsp; &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Jul 2014 10:25:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Espa%C3%B1ol/Intervalos-entre-fechas-de-pedido/m-p/695011#M5202</guid>
      <dc:creator />
      <dc:date>2014-07-17T10:25:14Z</dc:date>
    </item>
    <item>
      <title>Re: Intervalos entre fechas de pedido</title>
      <link>https://community.qlik.com/t5/Espa%C3%B1ol/Intervalos-entre-fechas-de-pedido/m-p/695012#M5203</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Analizando y validando resultados, he caído en la cuenta de que un mismo cliente puede ser trabajado por varios vendedores, por lo que habría que controlar que se calcule el intervalo entre pedidos de cada vendedor en el mismo cliente.&lt;/P&gt;&lt;P&gt;Se me ocurre hacer un bucle variando el vendedor en cada pasada, pero me temo que podría ser bastante ineficaz.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Jul 2014 11:45:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Espa%C3%B1ol/Intervalos-entre-fechas-de-pedido/m-p/695012#M5203</guid>
      <dc:creator />
      <dc:date>2014-07-17T11:45:55Z</dc:date>
    </item>
    <item>
      <title>Re: Intervalos entre fechas de pedido</title>
      <link>https://community.qlik.com/t5/Espa%C3%B1ol/Intervalos-entre-fechas-de-pedido/m-p/695013#M5204</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Entonces podrías quitar al ID_Vendedor del Group By para que no afecte el vendedor en los cálculos.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Jul 2014 12:09:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Espa%C3%B1ol/Intervalos-entre-fechas-de-pedido/m-p/695013#M5204</guid>
      <dc:creator>etendero</dc:creator>
      <dc:date>2014-07-17T12:09:35Z</dc:date>
    </item>
    <item>
      <title>Re: Intervalos entre fechas de pedido</title>
      <link>https://community.qlik.com/t5/Espa%C3%B1ol/Intervalos-entre-fechas-de-pedido/m-p/695014#M5205</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;¿En que group by?&amp;nbsp; para el calculo del intervalo entre pedidos no hay ninguno...&amp;nbsp;&amp;nbsp; &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/sad.png" /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Jul 2014 12:51:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Espa%C3%B1ol/Intervalos-entre-fechas-de-pedido/m-p/695014#M5205</guid>
      <dc:creator />
      <dc:date>2014-07-17T12:51:34Z</dc:date>
    </item>
    <item>
      <title>Re: Intervalos entre fechas de pedido</title>
      <link>https://community.qlik.com/t5/Espa%C3%B1ol/Intervalos-entre-fechas-de-pedido/m-p/695015#M5206</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;El Group By que te puse en la tabla Pedidos_aux de la respuesta &lt;A href="https://community.qlik.com/message/570665"&gt;Re: Intervalos entre fechas de pedido&lt;/A&gt;, a no ser que te haya entendido mal el último problema que me has comentado.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Jul 2014 12:58:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Espa%C3%B1ol/Intervalos-entre-fechas-de-pedido/m-p/695015#M5206</guid>
      <dc:creator>etendero</dc:creator>
      <dc:date>2014-07-17T12:58:37Z</dc:date>
    </item>
    <item>
      <title>Re: Intervalos entre fechas de pedido</title>
      <link>https://community.qlik.com/t5/Espa%C3%B1ol/Intervalos-entre-fechas-de-pedido/m-p/695016#M5207</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;¿Te refieres al order by?&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;Pedidos_aux:&lt;/P&gt;&lt;P&gt;LOAD ...&lt;/P&gt;&lt;P&gt;&amp;nbsp; , ID_CLIENTE&lt;/P&gt;&lt;P&gt;&amp;nbsp; , ID_VENDEDOR&lt;/P&gt;&lt;P&gt;&amp;nbsp; , FECHA_PEDIDO&lt;/P&gt;&lt;P&gt;&amp;nbsp; , DayNumberOfYear(FECHA_PEDIDO) - DayNumberOfYear(Previous(FECHA_PEDIDO)) as DIAS_DISTANCIA&lt;/P&gt;&lt;P&gt;Resident Pedidos&lt;/P&gt;&lt;P&gt;Order by ID_CLIENTE, ID_VENDEDOR, FECHA_PEDIDO;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DROP Table Pedidos;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pedidos:&lt;/P&gt;&lt;P&gt;LOAD *&lt;/P&gt;&lt;P&gt;Resident Pedidos_aux&lt;/P&gt;&lt;P&gt;Where DIAS_DISTANCIA &amp;gt; 365&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DROP Table Pedidos_aux;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Jul 2014 13:09:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Espa%C3%B1ol/Intervalos-entre-fechas-de-pedido/m-p/695016#M5207</guid>
      <dc:creator />
      <dc:date>2014-07-17T13:09:37Z</dc:date>
    </item>
    <item>
      <title>Re: Intervalos entre fechas de pedido</title>
      <link>https://community.qlik.com/t5/Espa%C3%B1ol/Intervalos-entre-fechas-de-pedido/m-p/695017#M5208</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;También he detectado que se me duplican las fechas, apareciendo una con la diferencia de días entre pedidos y la otra a 0:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 391px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl63" height="17" width="186"&gt;ID_VENDEDOR&lt;BR /&gt;&amp;nbsp; - ID_CLIENTE&lt;/TD&gt;&lt;TD class="xl63" style="border-left-color: currentColor; border-left-width: medium; border-left-style: none;" width="109"&gt;FECHA&lt;/TD&gt;&lt;TD class="xl63" style="border-left-color: currentColor; border-left-width: medium; border-left-style: none;" width="96"&gt;DIAS DISTANCIA&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="17" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;000044-022709&lt;/TD&gt;&lt;TD class="xl64" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;24/06/14&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;-542&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="17" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;000044-022709&lt;/TD&gt;&lt;TD class="xl64" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;24/06/14&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="17" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;000044-022709&lt;/TD&gt;&lt;TD class="xl64" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;18/12/13&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="17" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;000044-022709&lt;/TD&gt;&lt;TD class="xl64" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;18/12/13&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;6&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="17" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;000044-022709&lt;/TD&gt;&lt;TD class="xl64" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;12/12/13&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="17" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;000044-022709&lt;/TD&gt;&lt;TD class="xl64" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;12/12/13&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;64&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="17" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;000044-022709&lt;/TD&gt;&lt;TD class="xl64" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;09/10/13&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="17" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;000044-022709&lt;/TD&gt;&lt;TD class="xl64" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;09/10/13&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;125&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="17" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;000044-022709&lt;/TD&gt;&lt;TD class="xl64" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;06/06/13&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="17" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;000044-022709&lt;/TD&gt;&lt;TD class="xl64" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;06/06/13&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;76&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="17" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;000044-022709&lt;/TD&gt;&lt;TD class="xl64" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;22/03/13&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="17" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;000044-022709&lt;/TD&gt;&lt;TD class="xl64" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;22/03/13&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;55&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="17" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;000044-022709&lt;/TD&gt;&lt;TD class="xl64" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;27/01/13&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;-634&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="17" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;000044-022709&lt;/TD&gt;&lt;TD class="xl64" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;27/01/13&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="17" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;000044-022709&lt;/TD&gt;&lt;TD class="xl64" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;22/10/12&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="17" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;000044-022709&lt;/TD&gt;&lt;TD class="xl64" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;22/10/12&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;48&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="17" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;000044-022709&lt;/TD&gt;&lt;TD class="xl64" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;04/09/12&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="17" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;000044-022709&lt;/TD&gt;&lt;TD class="xl64" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;04/09/12&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;76&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="17" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;000044-022709&lt;/TD&gt;&lt;TD class="xl64" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;20/06/12&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="17" style="border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;000044-022709&lt;/TD&gt;&lt;TD class="xl64" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;20/06/12&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;47&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Jul 2014 13:34:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Espa%C3%B1ol/Intervalos-entre-fechas-de-pedido/m-p/695017#M5208</guid>
      <dc:creator />
      <dc:date>2014-07-17T13:34:51Z</dc:date>
    </item>
    <item>
      <title>Re: Intervalos entre fechas de pedido</title>
      <link>https://community.qlik.com/t5/Espa%C3%B1ol/Intervalos-entre-fechas-de-pedido/m-p/695018#M5209</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Disculpa Juan Antonio, cuando te escribí el primer código, quise poner Group By en vez de Order By. Mi intención era la de quitar los repetidos y dejar las combinaciones de ID_CLIENTE, ID_VENDEDOR y FECHA_PEDIDO diferentes. Por lo tanto, me refería a que hicieras el Group By ID_CLIENTE, FECHA_PEDIDO porque al quitar el ID_VENDEDOR, te aparecen las fechas de pedido independientemente del vendedor.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Un saludo y disculpa una vez más por la confusión.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Jul 2014 23:31:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Espa%C3%B1ol/Intervalos-entre-fechas-de-pedido/m-p/695018#M5209</guid>
      <dc:creator>etendero</dc:creator>
      <dc:date>2014-07-17T23:31:03Z</dc:date>
    </item>
    <item>
      <title>Re: Intervalos entre fechas de pedido</title>
      <link>https://community.qlik.com/t5/Espa%C3%B1ol/Intervalos-entre-fechas-de-pedido/m-p/695019#M5210</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hola Emilio.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pero al no tener ninguna agregación, ¿funcionaria el group by?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Jul 2014 06:59:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Espa%C3%B1ol/Intervalos-entre-fechas-de-pedido/m-p/695019#M5210</guid>
      <dc:creator />
      <dc:date>2014-07-18T06:59:59Z</dc:date>
    </item>
    <item>
      <title>Re: Intervalos entre fechas de pedido</title>
      <link>https://community.qlik.com/t5/Espa%C3%B1ol/Intervalos-entre-fechas-de-pedido/m-p/695020#M5211</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Como lo estamos montando en el script, con un Group By no hace falta una función de agregación como tal, con utilizar algún tipo de formula u operación es suficiente. Mi propuesta quedaría de la siguiente forma:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;PedidosClientes:&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;LOAD&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp; , ID_CLIENTE&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp; , FECHA_PEDIDO&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp; , Autogenerate(ID_CLIENTE &amp;amp; '-' &amp;amp; FECHA_PEDIDO) as ID_PedidosClientes&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp; , (DayNumberOfYear(FECHA_PEDIDO)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; + (((Year(Today()) - Year(FECHA_PEDIDO))&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * 365))&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp; - (DayNumberOfYear(Previous(FECHA_PEDIDO))&amp;nbsp; + (((Year(Today()) - Year(Previous(FECHA_PEDIDO))) * 365))&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp; as DIAS_DISTANCIA&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;Resident Pedidos&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;Group by ID_CLIENTE, FECHA_PEDIDO;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;Inner Join(Pedidos)&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;LOAD ID_PedidosClientes&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp; , DIAS_DISTANCIA&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;Resident PedidosClientes&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;Where DIAS_DISTANCIA &amp;gt; 365&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;DROP Table PedidosClientes;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;He modificado algo más la propuesta para adaptarlo un poco más, dentro de mi desconocimiento de tu modelo de datos. Ahora utilizo un Inner Join para reducir tu tabla de pedidos. He generado una clave única con ID_CLIENTE y FECHA_PEDIDO para que no te cree una tabla sintética. Tendrás que añadir esa clave única también en tu tabla de Pedidos para que funcione la relación.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Un saludo.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Jul 2014 07:46:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Espa%C3%B1ol/Intervalos-entre-fechas-de-pedido/m-p/695020#M5211</guid>
      <dc:creator>etendero</dc:creator>
      <dc:date>2014-07-18T07:46:55Z</dc:date>
    </item>
    <item>
      <title>Re: Intervalos entre fechas de pedido</title>
      <link>https://community.qlik.com/t5/Espa%C3%B1ol/Intervalos-entre-fechas-de-pedido/m-p/695021#M5212</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hola Emilio.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Ya logre hacerlo funcionar. Finalmente el código ha quedado se esta manera:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;DISTANCIA_ENTRE_PEDIDOS:&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;LOAD&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;ID_VENDEDOR,&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;ID_CLIENTE,&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;FECHA_PEDIDO,&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;SUM((DAYNUMBEROFYEAR(FECHA_PEDIDO) + ((YEAR(FECHA_PEDIDO)-(YEAR(TODAY()))) * 365))&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;- &lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;(DAYNUMBEROFYEAR(PREVIOUS(FECHA_PEDIDO))+((YEAR(PREVIOUS(FECHA_PEDIDO))-YEAR(TODAY())) * 365))) AS DIAS_ENTRE_PEDIDOS,&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;STRONG&gt;&lt;EM&gt;NUM((DAYNUMBEROFYEAR(TODAY()))&amp;nbsp; &lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;-&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;(DAYNUMBEROFYEAR(FECHA_PEDIDO) + ((YEAR(FECHA_PEDIDO)-YEAR(TODAY() )) * 365))) AS DIAS_HASTA_HOY&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;RESIDENT PEDIDOS&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;GROUP BY ID_VENDEDOR, ID_CLIENTE, FECHA_PEDIDO;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;He modificado la parte en la que calculábamos el decalaje del año, haciendo que el año del pedido menos el año del hoy.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Por otra parte he calculado el numero de días con respecto a hoy de cada pedido.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;De esta manera podre ver el numero de días a cada pedido y la distancia entre ellos.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Muchisimas gracias por tu ayuda Emilio. Ha sido la típica cosa que sobre el papel no parecía complicada de calcular, pero al final ha llevado su tiempo.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Un saludo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Jul 2014 11:07:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Espa%C3%B1ol/Intervalos-entre-fechas-de-pedido/m-p/695021#M5212</guid>
      <dc:creator />
      <dc:date>2014-07-18T11:07:41Z</dc:date>
    </item>
    <item>
      <title>Re: Intervalos entre fechas de pedido</title>
      <link>https://community.qlik.com/t5/Espa%C3%B1ol/Intervalos-entre-fechas-de-pedido/m-p/695022#M5213</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Me alegro de que lo hayas conseguido.&lt;/P&gt;&lt;P&gt;Un saludo.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Jul 2014 11:20:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Espa%C3%B1ol/Intervalos-entre-fechas-de-pedido/m-p/695022#M5213</guid>
      <dc:creator>etendero</dc:creator>
      <dc:date>2014-07-18T11:20:47Z</dc:date>
    </item>
  </channel>
</rss>

