<?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: Expression Help! in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Expression-Help/m-p/529239#M1134331</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi JV&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not sure, I'm very new to QlikView.... My Script is below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: blue; font-size: 9.0pt; font-family: 'Courier New';"&gt;SQL&lt;/STRONG&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt; SELECT CostCentreCode,&lt;BR /&gt; ExpenseCode,&lt;BR /&gt; Period,&lt;BR /&gt; 2000 + LEFT(Period,2) as PeriodYear,&lt;BR /&gt; RIGHT(Period,2) as PeriodMonth,&amp;nbsp; &lt;BR /&gt; NetValue&lt;BR /&gt; FROM F8LIVE.dbo.F8NLTRANS; &lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 25 Oct 2013 15:16:47 GMT</pubDate>
    <dc:creator>james_butler</dc:creator>
    <dc:date>2013-10-25T15:16:47Z</dc:date>
    <item>
      <title>Expression Help!</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-Help/m-p/529236#M1134328</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm struggling with the a relatively simply formula, I'm try to get the total for an expense code, for last period.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried both of the below and neither seem to work, can anyone help?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt;=-&lt;/SPAN&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: blue;"&gt;Sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt;({$&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: maroon;"&gt;PeriodMonth&lt;/SPAN&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt;={&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: gray; font-size: 12.0pt; font-family: 'Courier New';"&gt;$(=Only(PeriodMonth-1))&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt;}&amp;gt;} {$&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: maroon;"&gt;PeriodYear&lt;/SPAN&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt;={&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: gray; font-size: 12.0pt; font-family: 'Courier New';"&gt;$(=Only(PeriodYear))&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt;}&amp;gt;} {$&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: maroon;"&gt;ExpenseCode&lt;/SPAN&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt; = {50000}&amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: maroon;"&gt;NetValue&lt;/SPAN&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt;) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt;=-&lt;/SPAN&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: blue;"&gt;Sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt;({$&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: maroon;"&gt;PeriodMonth&lt;/SPAN&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt;={&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: gray; font-size: 12.0pt; font-family: 'Courier New';"&gt;$(=Only(PeriodMonth)-1)&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt;}&amp;gt;} {$&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: maroon;"&gt;PeriodYear&lt;/SPAN&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt;={&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: gray; font-size: 12.0pt; font-family: 'Courier New';"&gt;$(=Only(PeriodYear))&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt;}&amp;gt;} {$&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: maroon;"&gt;ExpenseCode&lt;/SPAN&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt; = {50000}&amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: maroon;"&gt;NetValue&lt;/SPAN&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt;) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My formula for this period works fine.....&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;=-&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;Sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;({$&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;PeriodMonth&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;={&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: gray; font-size: 9.0pt; font-family: 'Courier New';"&gt;$(=Only(PeriodMonth))&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;}&amp;gt;} {$&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;PeriodYear&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;={&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: gray; font-size: 9.0pt; font-family: 'Courier New';"&gt;$(=Only(PeriodYear))&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;}&amp;gt;} {$&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;ExpenseCode&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt; = {50000}&amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;NetValue&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;James&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;&lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Oct 2013 14:59:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-Help/m-p/529236#M1134328</guid>
      <dc:creator>james_butler</dc:creator>
      <dc:date>2013-10-25T14:59:39Z</dc:date>
    </item>
    <item>
      <title>Re: Expression Help!</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-Help/m-p/529237#M1134329</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think your field modifier should look like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM style="color: gray; font-size: 12.0pt; font-family: 'Courier New';"&gt;$(=Only(PeriodMonth)-1)&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also think that you shouldn't use multiple set expressions, try instead&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt;=-&lt;/SPAN&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: blue;"&gt;Sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt;({$&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: maroon;"&gt;PeriodMonth&lt;/SPAN&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt;={&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: gray; font-size: 12.0pt; font-family: 'Courier New';"&gt;$(=Only(PeriodMonth)-1)&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt;}, &lt;/SPAN&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: maroon;"&gt;PeriodYear&lt;/SPAN&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt;={&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: gray; font-size: 12.0pt; font-family: 'Courier New';"&gt;$(=Only(PeriodYear))&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt;}, &lt;/SPAN&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: maroon;"&gt;ExpenseCode&lt;/SPAN&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt; = {50000}&amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: maroon;"&gt;NetValue&lt;/SPAN&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt;) &lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Oct 2013 15:04:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-Help/m-p/529237#M1134329</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2013-10-25T15:04:02Z</dc:date>
    </item>
    <item>
      <title>Re: Expression Help!</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-Help/m-p/529238#M1134330</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Is your period month a numeric value?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;JV&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Oct 2013 15:13:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-Help/m-p/529238#M1134330</guid>
      <dc:creator>jvitantonio</dc:creator>
      <dc:date>2013-10-25T15:13:22Z</dc:date>
    </item>
    <item>
      <title>Re: Expression Help!</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-Help/m-p/529239#M1134331</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi JV&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not sure, I'm very new to QlikView.... My Script is below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: blue; font-size: 9.0pt; font-family: 'Courier New';"&gt;SQL&lt;/STRONG&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt; SELECT CostCentreCode,&lt;BR /&gt; ExpenseCode,&lt;BR /&gt; Period,&lt;BR /&gt; 2000 + LEFT(Period,2) as PeriodYear,&lt;BR /&gt; RIGHT(Period,2) as PeriodMonth,&amp;nbsp; &lt;BR /&gt; NetValue&lt;BR /&gt; FROM F8LIVE.dbo.F8NLTRANS; &lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Oct 2013 15:16:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-Help/m-p/529239#M1134331</guid>
      <dc:creator>james_butler</dc:creator>
      <dc:date>2013-10-25T15:16:47Z</dc:date>
    </item>
    <item>
      <title>Re: Expression Help!</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-Help/m-p/529240#M1134332</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, what's the value inside "Period"? Give me an example of the data contained in that field.&lt;/P&gt;&lt;P&gt;I guess Period is something like 13/10 with format "YY/MM"?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Be careful the way you use your expression, as it will not work in January. Ex: 01 - 1 = 0 and not 12&lt;/P&gt;&lt;P&gt;You can create a sequential month field like:&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;YEAR*12+MONTH AS YearMonthSequential. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will give you a unique and sequential value for each YearMonth. Then it's easy to do Max(YearMonthSequential)-1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Give it a try and let me know.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;JV&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Oct 2013 16:36:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-Help/m-p/529240#M1134332</guid>
      <dc:creator>jvitantonio</dc:creator>
      <dc:date>2013-10-25T16:36:03Z</dc:date>
    </item>
  </channel>
</rss>

