<?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 Using a variable to calculate a period in an expression in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Using-a-variable-to-calculate-a-period-in-an-expression/m-p/1446332#M433420</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;I would like to use a report in QV the present results based on the current period in our general ledger system.&lt;/P&gt;&lt;P&gt;I am loading the field cur_period from the general ledger system&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Period:&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;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;select&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; p.period as cur_period from acrtransgr p&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;I then set up a variable vCur_period with the definition&amp;nbsp; =cur_period&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;And then in the expression have used &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;({$ &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;period&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = {&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;"=$(vCur_period)"&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;} &amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Count&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;to try to pick up the current period, but it doesn't seem to recognise the variable.&amp;nbsp; What am I doing wrong?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Many thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Paul&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 27 Oct 2017 11:03:42 GMT</pubDate>
    <dc:creator>paul_ripley</dc:creator>
    <dc:date>2017-10-27T11:03:42Z</dc:date>
    <item>
      <title>Using a variable to calculate a period in an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Using-a-variable-to-calculate-a-period-in-an-expression/m-p/1446332#M433420</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;I would like to use a report in QV the present results based on the current period in our general ledger system.&lt;/P&gt;&lt;P&gt;I am loading the field cur_period from the general ledger system&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Period:&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;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;select&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; p.period as cur_period from acrtransgr p&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;I then set up a variable vCur_period with the definition&amp;nbsp; =cur_period&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;And then in the expression have used &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;({$ &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;period&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = {&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;"=$(vCur_period)"&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;} &amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Count&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;to try to pick up the current period, but it doesn't seem to recognise the variable.&amp;nbsp; What am I doing wrong?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Many thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Paul&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Oct 2017 11:03:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-a-variable-to-calculate-a-period-in-an-expression/m-p/1446332#M433420</guid>
      <dc:creator>paul_ripley</dc:creator>
      <dc:date>2017-10-27T11:03:42Z</dc:date>
    </item>
    <item>
      <title>Re: Using a variable to calculate a period in an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Using-a-variable-to-calculate-a-period-in-an-expression/m-p/1446333#M433421</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How you defile the variable? May be this?&lt;/P&gt;&lt;P&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: 8pt; font-family: inherit;"&gt;&lt;SPAN style="color: #000000; font-style: inherit; font-size: 10pt; font-family: arial, helvetica, sans-serif; font-weight: inherit;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif; color: #000000;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;({$ &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;period&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt; = {&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;"=$(&lt;STRONG style="color: #ff0000;"&gt;=&lt;/STRONG&gt;vCur_period)"&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;} &amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;Count&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-style: inherit; font-family: arial, helvetica, sans-serif; font-weight: inherit;"&gt;)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt; font-style: inherit; font-family: inherit; font-weight: inherit;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Oct 2017 11:10:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-a-variable-to-calculate-a-period-in-an-expression/m-p/1446333#M433421</guid>
      <dc:creator>Anil_Babu_Samineni</dc:creator>
      <dc:date>2017-10-27T11:10:09Z</dc:date>
    </item>
    <item>
      <title>Re: Using a variable to calculate a period in an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Using-a-variable-to-calculate-a-period-in-an-expression/m-p/1446334#M433422</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How about this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=Sum({$&amp;lt;period = &lt;SPAN style="color: #ff0000;"&gt;p(cur_period)&lt;/SPAN&gt;&amp;gt;} Count)&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Oct 2017 11:12:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-a-variable-to-calculate-a-period-in-an-expression/m-p/1446334#M433422</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-10-27T11:12:18Z</dc:date>
    </item>
    <item>
      <title>Re: Using a variable to calculate a period in an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Using-a-variable-to-calculate-a-period-in-an-expression/m-p/1446335#M433423</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Sunny that worked.&amp;nbsp; Can I just ask you the significance of the 'p' before (cur_period)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Oct 2017 13:03:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-a-variable-to-calculate-a-period-in-an-expression/m-p/1446335#M433423</guid>
      <dc:creator>paul_ripley</dc:creator>
      <dc:date>2017-10-27T13:03:35Z</dc:date>
    </item>
    <item>
      <title>Re: Using a variable to calculate a period in an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Using-a-variable-to-calculate-a-period-in-an-expression/m-p/1446336#M433424</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;p() and e() are part of indirect set analysis... look here:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/thread/68931"&gt;P() &amp;amp;amp; E() and where do you use them?&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Oct 2017 13:18:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-a-variable-to-calculate-a-period-in-an-expression/m-p/1446336#M433424</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-10-27T13:18:13Z</dc:date>
    </item>
    <item>
      <title>Re: Using a variable to calculate a period in an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Using-a-variable-to-calculate-a-period-in-an-expression/m-p/1446337#M433425</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Also here:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/message/501560"&gt;P() &amp;amp;amp; E()&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Oct 2017 13:18:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-a-variable-to-calculate-a-period-in-an-expression/m-p/1446337#M433425</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-10-27T13:18:55Z</dc:date>
    </item>
  </channel>
</rss>

