<?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 VARIABLES EN UNA CONSULTA SQL in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/VARIABLES-EN-UNA-CONSULTA-SQL/m-p/2462#M167</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hola Buenas Tardes&lt;/P&gt;&lt;P&gt;Tengo un problema con scripts de QlikView en el uso de Variables, sucede lo siguiente&lt;/P&gt;&lt;P&gt;1.- Tengo una consulta inicial que me devuelve los datos de ventas del ultimo dia de venta.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;VentasDiaAIDISA:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SQL&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SELECT DISTINCT TOP (1) Fecha&amp;nbsp; FROM TblHVentasAcumuladasAlim WHERE fecha &amp;gt;= '$(V_FechaInicioGestionAct)' ORDER BY Fecha DESC ) &lt;/P&gt;&lt;P&gt;STORE VentasDiaAIDISA INTO VentasDiaAIDISA.qvd;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2.- Tengo otra consulta que necesito tomar la Fecha de la consulta anterior para Filtrar los datos de esta ultima consulta&lt;/P&gt;&lt;P&gt;VentaAidisaAcumUlmFechaVenta:&lt;/P&gt;&lt;P&gt;SQL&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;SELECT *&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;FROM&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TblHVentasGestiones V&lt;/P&gt;&lt;P&gt;WHERE &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;V.Fecha =&amp;nbsp; &lt;STRONG style="text-decoration: underline;"&gt;FechaAnteriorConsulta&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Store VentaAidisaAcumUlmFechaVenta INTO VentaAidisaAcumUlmFechaVenta.qvd;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alguien tiene idea de como realizar este filtro en la segunda consulta??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Comentarles que hize un Join entre las dos Tablas pero en temas de rendimiento en la consulta y los volumnes de datos la consulta demora demasiado tiempo con el join.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;gracias de antemano por su ayuda&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;saludos&lt;/P&gt;&lt;P&gt;Ariel Coca&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 17 Jan 2018 22:56:08 GMT</pubDate>
    <dc:creator>arielcoca</dc:creator>
    <dc:date>2018-01-17T22:56:08Z</dc:date>
    <item>
      <title>VARIABLES EN UNA CONSULTA SQL</title>
      <link>https://community.qlik.com/t5/App-Development/VARIABLES-EN-UNA-CONSULTA-SQL/m-p/2462#M167</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hola Buenas Tardes&lt;/P&gt;&lt;P&gt;Tengo un problema con scripts de QlikView en el uso de Variables, sucede lo siguiente&lt;/P&gt;&lt;P&gt;1.- Tengo una consulta inicial que me devuelve los datos de ventas del ultimo dia de venta.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;VentasDiaAIDISA:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SQL&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SELECT DISTINCT TOP (1) Fecha&amp;nbsp; FROM TblHVentasAcumuladasAlim WHERE fecha &amp;gt;= '$(V_FechaInicioGestionAct)' ORDER BY Fecha DESC ) &lt;/P&gt;&lt;P&gt;STORE VentasDiaAIDISA INTO VentasDiaAIDISA.qvd;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2.- Tengo otra consulta que necesito tomar la Fecha de la consulta anterior para Filtrar los datos de esta ultima consulta&lt;/P&gt;&lt;P&gt;VentaAidisaAcumUlmFechaVenta:&lt;/P&gt;&lt;P&gt;SQL&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;SELECT *&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;FROM&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TblHVentasGestiones V&lt;/P&gt;&lt;P&gt;WHERE &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;V.Fecha =&amp;nbsp; &lt;STRONG style="text-decoration: underline;"&gt;FechaAnteriorConsulta&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Store VentaAidisaAcumUlmFechaVenta INTO VentaAidisaAcumUlmFechaVenta.qvd;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alguien tiene idea de como realizar este filtro en la segunda consulta??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Comentarles que hize un Join entre las dos Tablas pero en temas de rendimiento en la consulta y los volumnes de datos la consulta demora demasiado tiempo con el join.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;gracias de antemano por su ayuda&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;saludos&lt;/P&gt;&lt;P&gt;Ariel Coca&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Jan 2018 22:56:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/VARIABLES-EN-UNA-CONSULTA-SQL/m-p/2462#M167</guid>
      <dc:creator>arielcoca</dc:creator>
      <dc:date>2018-01-17T22:56:08Z</dc:date>
    </item>
    <item>
      <title>Re: VARIABLES EN UNA CONSULTA SQL</title>
      <link>https://community.qlik.com/t5/App-Development/VARIABLES-EN-UNA-CONSULTA-SQL/m-p/2463#M168</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hola Ariel, puedes gaurdar el valor en una variable:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;LET vFechaAnterior = Peek('&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Fecha', 0, '&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;VentasDiaAIDISA&lt;/SPAN&gt;');&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Y usar esta variable como filtro:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;SQL&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;SELECT *&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;FROM&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TblHVentasGestiones V&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;WHERE&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;V.Fecha =&amp;nbsp; $(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;vFechaAnterior&lt;/SPAN&gt;&lt;STRONG style="font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;Al ser una fecha puede que tengas que modificar el formato de la variable hasta devolverlo tal como lo espera el servidor.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;También hay un lugar para consultas en español: &lt;A href="https://community.qlik.com/group/1022"&gt;Qlik en Español&lt;/A&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Jan 2018 17:50:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/VARIABLES-EN-UNA-CONSULTA-SQL/m-p/2463#M168</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2018-01-18T17:50:47Z</dc:date>
    </item>
    <item>
      <title>Re: VARIABLES EN UNA CONSULTA SQL</title>
      <link>https://community.qlik.com/t5/App-Development/VARIABLES-EN-UNA-CONSULTA-SQL/m-p/2464#M169</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Te agradesco estimado Ruben, salio todo perfecto, esto me ayuda a mejorar el tiempo de carga de otras consultas&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Saludos&lt;/P&gt;&lt;P&gt;ACM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Jan 2018 22:19:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/VARIABLES-EN-UNA-CONSULTA-SQL/m-p/2464#M169</guid>
      <dc:creator>arielcoca</dc:creator>
      <dc:date>2018-01-18T22:19:31Z</dc:date>
    </item>
  </channel>
</rss>

