<?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: Calcular valor do periodo anterior in Brasil</title>
    <link>https://community.qlik.com/t5/Brasil/Calcular-valor-do-periodo-anterior/m-p/1254596#M44675</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;&lt;EM style="font-weight: inherit; font-size: 13.3333px; font-family: inherit;"&gt;sum({1 &amp;lt; [anomes] = {'$(vPeriodoAnterior)'}, &lt;STRONG style="font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;&lt;EM style="font-weight: inherit; font-size: 13.3333px; font-family: inherit;"&gt;setor = {"BALCAO"&lt;/EM&gt;&lt;/STRONG&gt;}&amp;gt;} valorpecas)&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;&lt;EM style="font-weight: inherit; font-size: 13.3333px; font-family: inherit;"&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 Feb 2017 17:56:26 GMT</pubDate>
    <dc:creator>Clever_Anjos</dc:creator>
    <dc:date>2017-02-10T17:56:26Z</dc:date>
    <item>
      <title>Calcular valor do periodo anterior</title>
      <link>https://community.qlik.com/t5/Brasil/Calcular-valor-do-periodo-anterior/m-p/1254595#M44674</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Pessoal, tenho uma aplicação que cálculo o lucro e tem como filtro selecionado sempre o mes atual.&lt;/P&gt;&lt;P&gt;Quero criar um indicador que compare o lucro do mês selecionado com o do período anterior.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Criei a variável :&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;vPeriodoAnterior&lt;/STRONG&gt;=date(addmonths(anomes,-1),'MM-yyyy')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Se eu faço uma soma simples pegando apenas o valor de peças, funciona perfeitamente, como abaixo:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;sum({1 &amp;lt; [anomes] = {'$(vPeriodoAnterior)'}&amp;gt;} valorpecas)&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Porém, para apurar o lucro tenho algumas regras e não estou conseguindo colocar condições para isso.&lt;/P&gt;&lt;P&gt;Por exemplo, quero que some o valorpecas apenas se o campo setor for igual a 'BALCAO'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tentei algo do tipo abaixo mas não deu certo:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;&lt;EM&gt;sum(if(setor = 'BALCAO',{1 &amp;lt; [anomes] = {'$(vPeriodoAnterior)'}&amp;gt;} valorpecas))&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Alguma dica?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Obrigado!&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Feb 2017 17:35:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Brasil/Calcular-valor-do-periodo-anterior/m-p/1254595#M44674</guid>
      <dc:creator>brunoducatti</dc:creator>
      <dc:date>2017-02-10T17:35:49Z</dc:date>
    </item>
    <item>
      <title>Re: Calcular valor do periodo anterior</title>
      <link>https://community.qlik.com/t5/Brasil/Calcular-valor-do-periodo-anterior/m-p/1254596#M44675</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;&lt;EM style="font-weight: inherit; font-size: 13.3333px; font-family: inherit;"&gt;sum({1 &amp;lt; [anomes] = {'$(vPeriodoAnterior)'}, &lt;STRONG style="font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;&lt;EM style="font-weight: inherit; font-size: 13.3333px; font-family: inherit;"&gt;setor = {"BALCAO"&lt;/EM&gt;&lt;/STRONG&gt;}&amp;gt;} valorpecas)&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;&lt;EM style="font-weight: inherit; font-size: 13.3333px; font-family: inherit;"&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Feb 2017 17:56:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Brasil/Calcular-valor-do-periodo-anterior/m-p/1254596#M44675</guid>
      <dc:creator>Clever_Anjos</dc:creator>
      <dc:date>2017-02-10T17:56:26Z</dc:date>
    </item>
    <item>
      <title>Re: Calcular valor do periodo anterior</title>
      <link>https://community.qlik.com/t5/Brasil/Calcular-valor-do-periodo-anterior/m-p/1254597#M44676</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Clever, perfeito.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Agora uma outra dúvida relacionada.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Eu tenho a expressão:&lt;/P&gt;&lt;P&gt;sum(if(filtro='BALCAO',valorpecas)&lt;/P&gt;&lt;P&gt;/&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;sum(if(&lt;SPAN style="font-size: 13.3333px;"&gt;TOTAL if(&lt;/SPAN&gt;filtro='BALCAO',valorpecas)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Como eu utilizo nesta divisão do sum TOTAL?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Obrigado pela ajuda!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Feb 2017 18:58:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Brasil/Calcular-valor-do-periodo-anterior/m-p/1254597#M44676</guid>
      <dc:creator>brunoducatti</dc:creator>
      <dc:date>2017-02-10T18:58:41Z</dc:date>
    </item>
    <item>
      <title>Re: Calcular valor do periodo anterior</title>
      <link>https://community.qlik.com/t5/Brasil/Calcular-valor-do-periodo-anterior/m-p/1254598#M44677</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Evite usar "if"s use Set analysis sempre que puder (mais compacto, mais rápido, etc)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000; background-color: #f2f2f2;"&gt;sum({&amp;lt;filtro={'BALCAO'}&amp;gt;} valorpecas)&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000; background-color: #f2f2f2;"&gt;/&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000; background-color: #f2f2f2;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;sum(total &lt;SPAN style="color: #000000; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; background-color: #f2f2f2;"&gt;{&amp;lt;filtro={'BALCAO'}&amp;gt;}&lt;/SPAN&gt;valorpecas)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Feb 2017 11:32:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Brasil/Calcular-valor-do-periodo-anterior/m-p/1254598#M44677</guid>
      <dc:creator>Clever_Anjos</dc:creator>
      <dc:date>2017-02-14T11:32:24Z</dc:date>
    </item>
  </channel>
</rss>

