<?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: Último data composto pelo Status in Brasil</title>
    <link>https://community.qlik.com/t5/Brasil/%C3%9Altimo-data-composto-pelo-Status/m-p/1579933#M56668</link>
    <description>&lt;P&gt;Bom dia!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Otavio, obrigado pela ajuda , "conseguir resolver" o que precisava porém algumas linhas ficaram com duplicidade&lt;BR /&gt;&lt;BR /&gt;O primeiro arquivo que lhe encaminhei no fórum é um arquivo teste,&amp;nbsp; apliquei o script que me encaminho funciono perfeitamente no meu arquivo original "Gerar Indicador", porém quando insiro colunas nova na tabela,&lt;BR /&gt;como por exemplo CódOcoren,Status, aparecem linhas duplicatas&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Abaixo é um exemplo de algumas NF que não estão duplicadas&amp;nbsp;&lt;BR /&gt;NF: 23823147&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline"&gt;&lt;IMG src="https://community.qlik.com/t5/image/serverpage/image-id/11877i117D7E4BF76375AC/image-size/large?v=1.0&amp;amp;px=999" border="0" alt="ok qlik2.PNG" title="ok qlik2.PNG" /&gt;&lt;/SPAN&gt;&lt;BR /&gt;NF: 23823115&lt;BR /&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline"&gt;&lt;IMG src="https://community.qlik.com/t5/image/serverpage/image-id/11878iB4F88981C9EEA55C/image-size/large?v=1.0&amp;amp;px=999" border="0" alt="Ok Qlik.PNG" title="Ok Qlik.PNG" /&gt;&lt;/SPAN&gt;&lt;BR /&gt;Na evidência abaixo A NF: 23614187 está constando como duplicidade na tabela,&lt;BR /&gt;NF: 23614187,&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline"&gt;&lt;IMG src="https://community.qlik.com/t5/image/serverpage/image-id/11879i296A8BC6DE40857E/image-size/large?v=1.0&amp;amp;px=999" border="0" alt="ñ ok qlik 1.PNG" title="ñ ok qlik 1.PNG" /&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;Muito obrigado pela ajuda&lt;/P&gt;&lt;P&gt;Abraços;&lt;/P&gt;</description>
    <pubDate>Tue, 14 May 2019 13:14:58 GMT</pubDate>
    <dc:creator>Kaiquesbezerra</dc:creator>
    <dc:date>2019-05-14T13:14:58Z</dc:date>
    <item>
      <title>Último data composto pelo Status</title>
      <link>https://community.qlik.com/t5/Brasil/%C3%9Altimo-data-composto-pelo-Status/m-p/1578670#M56656</link>
      <description>&lt;P&gt;Prezados boa tarde tudo bem ?,&amp;nbsp;&lt;SPAN&gt;sou novato aqui e no mundo do QlikView.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Tenho uma tabela&amp;nbsp; onde preciso que ela sempre sejam preenchida com o data mais recente,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Olhei alguns dicas no fórum e conseguir criar dentro do script da seguinte forma&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;LOAD&lt;BR /&gt;date(max([DthOcorrencia])) as [Data Transformada],&lt;BR /&gt;[Nro Nota]&lt;BR /&gt;Resident Ocoren Group by [Nro Nota];&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;VDataMax = Peek('DataTransformada');&lt;BR /&gt;NoConcatenate&lt;BR /&gt;Dadosfim:&lt;BR /&gt;LOAD&lt;BR /&gt;*Resident Ocoren Where DthOcorrencia ='(VDataMax)';&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dtmaxqlik.PNG" style="width: 393px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/11799i0AC706AEC51E8E62/image-size/large?v=v2&amp;amp;px=999" role="button" title="dtmaxqlik.PNG" alt="dtmaxqlik.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;O script está me trazendo a data mais recente que aquele Nº de NF possui porém na planilha está sendo preenchida com as duas linhas de ocorrência, gostaria que na planilha fosse aprestando apenas a data mais recente composta pelo status, conforme exemplo abaixo&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DtMaxExcel.PNG" style="width: 367px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/11800i9EA783061DE2FE15/image-size/large?v=v2&amp;amp;px=999" role="button" title="DtMaxExcel.PNG" alt="DtMaxExcel.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Segue arquivo qvw em anexo para analise&lt;/P&gt;&lt;P&gt;Obrigado,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 May 2019 18:45:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Brasil/%C3%9Altimo-data-composto-pelo-Status/m-p/1578670#M56656</guid>
      <dc:creator>Kaiquesbezerra</dc:creator>
      <dc:date>2019-05-09T18:45:15Z</dc:date>
    </item>
    <item>
      <title>Re: Último data composto pelo Status</title>
      <link>https://community.qlik.com/t5/Brasil/%C3%9Altimo-data-composto-pelo-Status/m-p/1578965#M56658</link>
      <description>&lt;P&gt;Está sendo mostrado duas linhas porque a primeira tabela "Ocoren" ainda está em memória. Quando você faz um "Resident" ele cria uma nova tabela, então no fim do script você tem duas.&lt;/P&gt;&lt;P&gt;Se a primeira tabela é dispensável você pode fazer o seguinte depois do Resident:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;DROP TABLE Ocoren;&lt;/LI-CODE&gt;&lt;P&gt;Ou de um jeito sem usar Resident:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;	//	ocoren	//
	Ocoren:
LOAD NroNotaFiscal		 	as [Nro Nota], 
     IF(IsNull(CodOcorrenciaTransp),TipoEventoCorreio &amp;amp; StatusEventoCorreio,CodOcorrenciaTransp) AS CódOcoren,  
     StatusEventoCorreio, 
     TipoEventoCorreio, 
 Date([DthOcorrencia], 'DD/MM/YYYY') as [DthOcorrencia]


FROM
[\\srvarquivo\transportes\RELATÓRIOS DIÁRIOS\PERFORMANCE\OCORREN\2019\04 - ABRIL\30-04-2019 OCOREN.xlsx]
(ooxml, embedded labels, table is MegaQuery);


INNER JOIN(Ocoren)
LOAD
date(max([DthOcorrencia]))	as [DthOcorrencia],
[Nro Nota]
Resident Ocoren Group by [Nro Nota];&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 May 2019 12:45:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Brasil/%C3%9Altimo-data-composto-pelo-Status/m-p/1578965#M56658</guid>
      <dc:creator>marco_almeida</dc:creator>
      <dc:date>2019-05-10T12:45:43Z</dc:date>
    </item>
    <item>
      <title>Re: Último data composto pelo Status</title>
      <link>https://community.qlik.com/t5/Brasil/%C3%9Altimo-data-composto-pelo-Status/m-p/1579933#M56668</link>
      <description>&lt;P&gt;Bom dia!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Otavio, obrigado pela ajuda , "conseguir resolver" o que precisava porém algumas linhas ficaram com duplicidade&lt;BR /&gt;&lt;BR /&gt;O primeiro arquivo que lhe encaminhei no fórum é um arquivo teste,&amp;nbsp; apliquei o script que me encaminho funciono perfeitamente no meu arquivo original "Gerar Indicador", porém quando insiro colunas nova na tabela,&lt;BR /&gt;como por exemplo CódOcoren,Status, aparecem linhas duplicatas&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Abaixo é um exemplo de algumas NF que não estão duplicadas&amp;nbsp;&lt;BR /&gt;NF: 23823147&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline"&gt;&lt;IMG src="https://community.qlik.com/t5/image/serverpage/image-id/11877i117D7E4BF76375AC/image-size/large?v=1.0&amp;amp;px=999" border="0" alt="ok qlik2.PNG" title="ok qlik2.PNG" /&gt;&lt;/SPAN&gt;&lt;BR /&gt;NF: 23823115&lt;BR /&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline"&gt;&lt;IMG src="https://community.qlik.com/t5/image/serverpage/image-id/11878iB4F88981C9EEA55C/image-size/large?v=1.0&amp;amp;px=999" border="0" alt="Ok Qlik.PNG" title="Ok Qlik.PNG" /&gt;&lt;/SPAN&gt;&lt;BR /&gt;Na evidência abaixo A NF: 23614187 está constando como duplicidade na tabela,&lt;BR /&gt;NF: 23614187,&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline"&gt;&lt;IMG src="https://community.qlik.com/t5/image/serverpage/image-id/11879i296A8BC6DE40857E/image-size/large?v=1.0&amp;amp;px=999" border="0" alt="ñ ok qlik 1.PNG" title="ñ ok qlik 1.PNG" /&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;Muito obrigado pela ajuda&lt;/P&gt;&lt;P&gt;Abraços;&lt;/P&gt;</description>
      <pubDate>Tue, 14 May 2019 13:14:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Brasil/%C3%9Altimo-data-composto-pelo-Status/m-p/1579933#M56668</guid>
      <dc:creator>Kaiquesbezerra</dc:creator>
      <dc:date>2019-05-14T13:14:58Z</dc:date>
    </item>
    <item>
      <title>Re: Último data composto pelo Status</title>
      <link>https://community.qlik.com/t5/Brasil/%C3%9Altimo-data-composto-pelo-Status/m-p/1579962#M56669</link>
      <description>&lt;P&gt;Opa blz?&lt;/P&gt;&lt;P&gt;Ele está duplicando porque a ocorrência aconteceu no mesmo dia (08/04/2019). Você vai precisar de outro campo pra melhorar a agregação Max(). Digamos que o campo "CódOcorren" seja esse campo, então você deverá fazer:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;INNER JOIN(Ocoren)
LOAD
date(max([DthOcorrencia]))	as [DthOcorrencia],
max([CódOcorren]) as CódOcorren,
[Nro Nota]
Resident Ocoren Group by [Nro Nota];&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Se você tiver o&amp;nbsp;&lt;EM&gt;timestamp&lt;/EM&gt; (hora completa) seria melhor ou uma ordem de execução.&lt;/P&gt;</description>
      <pubDate>Tue, 14 May 2019 14:29:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Brasil/%C3%9Altimo-data-composto-pelo-Status/m-p/1579962#M56669</guid>
      <dc:creator>marco_almeida</dc:creator>
      <dc:date>2019-05-14T14:29:31Z</dc:date>
    </item>
    <item>
      <title>Re: Último data composto pelo Status</title>
      <link>https://community.qlik.com/t5/Brasil/%C3%9Altimo-data-composto-pelo-Status/m-p/1582217#M56717</link>
      <description>&lt;P&gt;&lt;FONT&gt;&lt;FONT&gt;Bom Dia!&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;&lt;FONT&gt;Otavio, obrigado pela ajuda, obter o script em meu QVD &lt;/FONT&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT&gt;&lt;FONT&gt;O arquivo original que meu Qlik está lendo está no formato abaixo&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;FONT&gt;&lt;FONT&gt;DthOcorrencia&lt;/FONT&gt;&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;FONT&gt;&lt;FONT&gt;05/11/19 11:47&lt;/FONT&gt;&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;FONT&gt;&lt;FONT&gt;13/5/19 23:04&lt;/FONT&gt;&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;FONT&gt;&lt;FONT&gt;14/5/19 0:33&lt;/FONT&gt;&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;FONT&gt;&lt;FONT&gt;14/5/19 18:34&lt;/FONT&gt;&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;&lt;FONT&gt;Abaixo está um exemplo do script funcionou; &lt;/FONT&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="qlik ok.PNG" style="width: 186px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/12351i80BECF287FD925DB/image-size/large?v=v2&amp;amp;px=999" role="button" title="qlik ok.PNG" alt="qlik ok.PNG" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT&gt;&lt;FONT&gt;Quando apliquei o mesmo script em um arquivo que é preenchido sem formato abaixo,&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;FONT&gt;&lt;FONT&gt;DthOcorrencia&lt;/FONT&gt;&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;FONT&gt;&lt;FONT&gt;14/05/2019 18:37 (-03: 00)&lt;/FONT&gt;&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;&lt;FONT&gt;O Qlik me retorna uma coluna no formato abaixo&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="qlik itrack.PNG" style="width: 364px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/12353i76E8456934E1A139/image-size/large?v=v2&amp;amp;px=999" role="button" title="qlik itrack.PNG" alt="qlik itrack.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;FONT&gt;&lt;FONT&gt;Grato !!!&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 20 May 2019 13:19:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Brasil/%C3%9Altimo-data-composto-pelo-Status/m-p/1582217#M56717</guid>
      <dc:creator>Kaiquesbezerra</dc:creator>
      <dc:date>2019-05-20T13:19:22Z</dc:date>
    </item>
  </channel>
</rss>

