<?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 Expression not working - MTD Values in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Expression-not-working-MTD-Values/m-p/1539713#M746899</link>
    <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a table as shown below,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="1.PNG" style="width: 581px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/5219i6F76EF8765BD7587/image-size/large?v=v2&amp;amp;px=999" role="button" title="1.PNG" alt="1.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Where my&lt;STRONG&gt; MTD = (Current month YTD) - (Previous month YTD)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Eg: for &lt;STRONG&gt;January -2018, MTD = (-12865) - 0 = -12865&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;for &lt;STRONG&gt;February - 2018 , MTD = (-32765) - (-12865) = 19900&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;What wrong in this expression? I've MonthYear and project number as dimensions.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Attached is the file for reference&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;Aggr(If(Only({1} Project_Number) = Above(TOTAL Only({1} Project_Number)),

If(Num_Month_Project_Cost = '$(vPreYearLastMonth)' and Year = '$(vPreYear)', 
0,
(If(Num_Month_Project_Cost = '$(vPreYearLastMonth)' and Year = '$(vPreYear)', 0, Sum(Updated_OEC_Budget)))
-
(If(Num_Month_Project_Cost = '$(vPreYearLastMonth)' and Year = '$(vPreYear)', 0, Sum(Forecast_Cost_to_Complete)))
-
(
Column(1)
))

- 

Alt(Above(TOTAL

If(Only({&amp;lt;MonthYear, Snapshot_Date&amp;gt;}Num_Month_Project_Cost) = '$(vPreYearLastMonth)' and Only({&amp;lt;MonthYear, Snapshot_Date&amp;gt;}Year) = '$(vPreYear)', 
	0,
	(If(Only({&amp;lt;MonthYear, Snapshot_Date&amp;gt;}Num_Month_Project_Cost) = '$(vPreYearLastMonth)' and Only({&amp;lt;MonthYear, Snapshot_Date&amp;gt;}Year) = '$(vPreYear)', 0, Sum(Updated_OEC_Budget)))
	-
	(If(Only({&amp;lt;MonthYear, Snapshot_Date&amp;gt;}Num_Month_Project_Cost) = '$(vPreYearLastMonth)' and Only({&amp;lt;MonthYear, Snapshot_Date&amp;gt;}Year) = '$(vPreYear)', 0, Sum(Forecast_Cost_to_Complete)))
	- 
	Only({&amp;lt;MonthYear,Snapshot_Date&amp;gt;}Column(1)))

),0),

	If(Num_Month_Project_Cost = '$(vPreYearLastMonth)' and Year = '$(vPreYear)', 0,
	
	(If(Num_Month_Project_Cost = '$(vPreYearLastMonth)' and Year = '$(vPreYear)', 0, Sum(Updated_OEC_Budget)))
	-
	(If(Num_Month_Project_Cost = '$(vPreYearLastMonth)' and Year = '$(vPreYear)', 0, Sum(Forecast_Cost_to_Complete)))
	-
	(
	Column(1)
	))

), Project_Number, MonthYear)&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Bhavesh&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 16 Nov 2024 04:33:21 GMT</pubDate>
    <dc:creator>bhaveshp90</dc:creator>
    <dc:date>2024-11-16T04:33:21Z</dc:date>
    <item>
      <title>Expression not working - MTD Values</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-not-working-MTD-Values/m-p/1539713#M746899</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a table as shown below,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="1.PNG" style="width: 581px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/5219i6F76EF8765BD7587/image-size/large?v=v2&amp;amp;px=999" role="button" title="1.PNG" alt="1.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Where my&lt;STRONG&gt; MTD = (Current month YTD) - (Previous month YTD)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Eg: for &lt;STRONG&gt;January -2018, MTD = (-12865) - 0 = -12865&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;for &lt;STRONG&gt;February - 2018 , MTD = (-32765) - (-12865) = 19900&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;What wrong in this expression? I've MonthYear and project number as dimensions.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Attached is the file for reference&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;Aggr(If(Only({1} Project_Number) = Above(TOTAL Only({1} Project_Number)),

If(Num_Month_Project_Cost = '$(vPreYearLastMonth)' and Year = '$(vPreYear)', 
0,
(If(Num_Month_Project_Cost = '$(vPreYearLastMonth)' and Year = '$(vPreYear)', 0, Sum(Updated_OEC_Budget)))
-
(If(Num_Month_Project_Cost = '$(vPreYearLastMonth)' and Year = '$(vPreYear)', 0, Sum(Forecast_Cost_to_Complete)))
-
(
Column(1)
))

- 

Alt(Above(TOTAL

If(Only({&amp;lt;MonthYear, Snapshot_Date&amp;gt;}Num_Month_Project_Cost) = '$(vPreYearLastMonth)' and Only({&amp;lt;MonthYear, Snapshot_Date&amp;gt;}Year) = '$(vPreYear)', 
	0,
	(If(Only({&amp;lt;MonthYear, Snapshot_Date&amp;gt;}Num_Month_Project_Cost) = '$(vPreYearLastMonth)' and Only({&amp;lt;MonthYear, Snapshot_Date&amp;gt;}Year) = '$(vPreYear)', 0, Sum(Updated_OEC_Budget)))
	-
	(If(Only({&amp;lt;MonthYear, Snapshot_Date&amp;gt;}Num_Month_Project_Cost) = '$(vPreYearLastMonth)' and Only({&amp;lt;MonthYear, Snapshot_Date&amp;gt;}Year) = '$(vPreYear)', 0, Sum(Forecast_Cost_to_Complete)))
	- 
	Only({&amp;lt;MonthYear,Snapshot_Date&amp;gt;}Column(1)))

),0),

	If(Num_Month_Project_Cost = '$(vPreYearLastMonth)' and Year = '$(vPreYear)', 0,
	
	(If(Num_Month_Project_Cost = '$(vPreYearLastMonth)' and Year = '$(vPreYear)', 0, Sum(Updated_OEC_Budget)))
	-
	(If(Num_Month_Project_Cost = '$(vPreYearLastMonth)' and Year = '$(vPreYear)', 0, Sum(Forecast_Cost_to_Complete)))
	-
	(
	Column(1)
	))

), Project_Number, MonthYear)&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Bhavesh&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 04:33:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-not-working-MTD-Values/m-p/1539713#M746899</guid>
      <dc:creator>bhaveshp90</dc:creator>
      <dc:date>2024-11-16T04:33:21Z</dc:date>
    </item>
    <item>
      <title>Re: Expression not working - MTD Values</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-not-working-MTD-Values/m-p/1539761#M746900</link>
      <description>&lt;P&gt;You have use Column(1) in your expression with Aggr()... Aggr() function doesn't recognize Column reference and hence you will need to replace the column reference with the expression itself...&lt;/P&gt;&lt;P&gt;I have updated the app, but make sure to add the set analysis to ignore&amp;nbsp;MonthYear, Snapshot_Date where we have used the expression instead of the Column function&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 628px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/5225i7B14EED255DD4131/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Feb 2019 16:03:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-not-working-MTD-Values/m-p/1539761#M746900</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-02-05T16:03:18Z</dc:date>
    </item>
    <item>
      <title>Re: Expression not working - MTD Values</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-not-working-MTD-Values/m-p/1539899#M746901</link>
      <description>&lt;P&gt;thank you&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/46628"&gt;@sunny_talwar&lt;/a&gt;&amp;nbsp;&lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://community.qlik.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Feb 2019 20:54:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-not-working-MTD-Values/m-p/1539899#M746901</guid>
      <dc:creator>bhaveshp90</dc:creator>
      <dc:date>2019-02-05T20:54:17Z</dc:date>
    </item>
  </channel>
</rss>

