<?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: AddYears() function doesn't work properly with Concatenate in Reporting Service &amp; Alerting</title>
    <link>https://community.qlik.com/t5/Reporting-Service-Alerting/AddYears-function-doesn-t-work-properly-with-Concatenate/m-p/1917373#M150</link>
    <description>&lt;P&gt;There's still the issue of Dtae being typo'd, but as you said, let's ignore that (but if that's the case in the original code, it could actually result in the exact problem you're describing because there won't be a concatenate or join on the date field since it's not spelled the same). &lt;/P&gt;
&lt;P&gt;One thing I'd try and check is the consistency of the date fields - in one case you are applying Date() to it and in another you're just using MonthEnd, and in the third you're just using AddYears(). I'd recommend using the same approach for all three and see if that gets them on the same page. I'm not sure if it's related, but without access to the data or a clear understanding of what's happening behind the scenes (for example, what is the "Previous Year" field in your table that's not in your script?) it's hard to guess what the issue might be.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 12 Apr 2022 10:14:25 GMT</pubDate>
    <dc:creator>Or</dc:creator>
    <dc:date>2022-04-12T10:14:25Z</dc:date>
    <item>
      <title>AddYears() function doesn't work properly with Concatenate</title>
      <link>https://community.qlik.com/t5/Reporting-Service-Alerting/AddYears-function-doesn-t-work-properly-with-Concatenate/m-p/1917322#M145</link>
      <description>&lt;P&gt;Hi Everyone! I've got a problem in Script Loader in Qlik Sense Desktop. I have two .qvd files one loaded via SQL script (Let's say QVD1) another loaded from static .xlsx (QVD2) file. They are absolutely the same.&lt;/P&gt;
&lt;P&gt;1. I've loaded firstly QVD1 then concatenated QVD2. I've even solved the problem of duplicated dates while concatenation (Thanks a lot to Qlik Community);&lt;/P&gt;
&lt;P&gt;2. Then I've created second table based on the concatenation using Addyears() function, that supposed to be the data of previous year;&lt;/P&gt;
&lt;P&gt;3. And at last joined it to the main table through left join.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Unqualify *;

[Tab1]:
LOAD
	[Flag],
	[City],
	Num#([Year]) as [Year],
    Date(MonthEnd(Date(MakeDate(Year(Date#([Created Dtae], 'YYYY-MM-DD')),Month(Date#([Created Dtae], 'YYYY-MM-DD')),Day(Date#([Created Dtae], 'YYYY-MM-DD'))), 'DD.MM.YYYY'))) AS [Created Dtae],
	[Month],
	[Amount]
 FROM QVD1
(qvd);

Concatenate [Tab1]:
LOAD
	[Flag] AS [Flag],
	[City] AS [City],
	Num#([Year]) AS [Year],
    MonthEnd([Created date]) as [Created Date], 
	[Month] AS [Month],
	[Amount]
 FROM QVD2
(qvd);


[Tab2]:
Load 
[Flag] as [FlagLastYear],
[City] as [CityLastYear],
[Created Date] as [Created Date Last],
[Amount] as [AmountLast]
Resident [Tab1];

Left Join ([Tab1])
Load
[FlagLastYear] as [Flag],
[CityLastYear] as [City],
[Created Date Last] as [Created Date],
[AmountLast] 
Resident [Tab2];
Drop Table [Tab2];&lt;/LI-CODE&gt;
&lt;P&gt;It's what I'm trying to do)))&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Adilet_Yessaliyev_0-1649753835078.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/76874iA2D5CD7A72DC49B9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Adilet_Yessaliyev_0-1649753835078.png" alt="Adilet_Yessaliyev_0-1649753835078.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;And this what I've got as a result&lt;BR /&gt;Can anyone explain me what's wrong with this script?&lt;BR /&gt;Thanks in advance&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Apr 2022 09:00:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Reporting-Service-Alerting/AddYears-function-doesn-t-work-properly-with-Concatenate/m-p/1917322#M145</guid>
      <dc:creator>Adilet_Yessaliyev</dc:creator>
      <dc:date>2022-04-12T09:00:06Z</dc:date>
    </item>
    <item>
      <title>Re: AddYears() function doesn't work properly with Concatenate</title>
      <link>https://community.qlik.com/t5/Reporting-Service-Alerting/AddYears-function-doesn-t-work-properly-with-Concatenate/m-p/1917332#M146</link>
      <description>&lt;P&gt;Probably the typo in 'date':&lt;/P&gt;
&lt;PRE class="lia-code-sample  language-markup"&gt;&lt;CODE&gt;[Created Dtae],&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 12 Apr 2022 09:18:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Reporting-Service-Alerting/AddYears-function-doesn-t-work-properly-with-Concatenate/m-p/1917332#M146</guid>
      <dc:creator>Or</dc:creator>
      <dc:date>2022-04-12T09:18:31Z</dc:date>
    </item>
    <item>
      <title>Re: AddYears() function doesn't work properly with Concatenate</title>
      <link>https://community.qlik.com/t5/Reporting-Service-Alerting/AddYears-function-doesn-t-work-properly-with-Concatenate/m-p/1917345#M147</link>
      <description>&lt;P&gt;Never mind typos - I've changed the real names in order with Security Requirements&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Apr 2022 09:30:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Reporting-Service-Alerting/AddYears-function-doesn-t-work-properly-with-Concatenate/m-p/1917345#M147</guid>
      <dc:creator>Adilet_Yessaliyev</dc:creator>
      <dc:date>2022-04-12T09:30:29Z</dc:date>
    </item>
    <item>
      <title>Re: AddYears() function doesn't work properly with Concatenate</title>
      <link>https://community.qlik.com/t5/Reporting-Service-Alerting/AddYears-function-doesn-t-work-properly-with-Concatenate/m-p/1917354#M148</link>
      <description>&lt;P&gt;Well, you can add to the list of things you seem to have misplaced the AddYears() function - there isn't one in your code &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;It may be a good idea to either post the original or clean up the changed version. &lt;/P&gt;</description>
      <pubDate>Tue, 12 Apr 2022 09:39:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Reporting-Service-Alerting/AddYears-function-doesn-t-work-properly-with-Concatenate/m-p/1917354#M148</guid>
      <dc:creator>Or</dc:creator>
      <dc:date>2022-04-12T09:39:04Z</dc:date>
    </item>
    <item>
      <title>Re: AddYears() function doesn't work properly with Concatenate</title>
      <link>https://community.qlik.com/t5/Reporting-Service-Alerting/AddYears-function-doesn-t-work-properly-with-Concatenate/m-p/1917364#M149</link>
      <description>&lt;P&gt;Oh My Goodness)))) Sorry&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Unqualify *;

[Tab1]:
LOAD
	[Flag],
	[City],
	Num#([Year]) as [Year],
    Date(MonthEnd(Date(MakeDate(Year(Date#([Created Date], 'YYYY-MM-DD')),Month(Date#([Created Date], 'YYYY-MM-DD')),Day(Date#([Created Date], 'YYYY-MM-DD'))), 'DD.MM.YYYY'))) AS [Created Dtae],
	[Month],
	[Amount]
 FROM QVD1
(qvd);

Concatenate [Tab1]:
LOAD
	[Flag] AS [Flag],
	[City] AS [City],
	Num#([Year]) AS [Year],
    MonthEnd([Created date]) as [Created Date], 
	[Month] AS [Month],
	[Amount]
 FROM QVD2
(qvd);


[Tab2]:
Load 
[Flag] as [FlagLastYear],
[City] as [CityLastYear],
AddYears([Created Date], 1) as [Created Date Last],
[Amount] as [AmountLast]
Resident [Tab1];

Left Join ([Tab1])
Load
[FlagLastYear] as [Flag],
[CityLastYear] as [City],
[Created Date Last] as [Created Date],
[AmountLast] 
Resident [Tab2];
Drop Table [Tab2];&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 12 Apr 2022 10:03:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Reporting-Service-Alerting/AddYears-function-doesn-t-work-properly-with-Concatenate/m-p/1917364#M149</guid>
      <dc:creator>Adilet_Yessaliyev</dc:creator>
      <dc:date>2022-04-12T10:03:11Z</dc:date>
    </item>
    <item>
      <title>Re: AddYears() function doesn't work properly with Concatenate</title>
      <link>https://community.qlik.com/t5/Reporting-Service-Alerting/AddYears-function-doesn-t-work-properly-with-Concatenate/m-p/1917373#M150</link>
      <description>&lt;P&gt;There's still the issue of Dtae being typo'd, but as you said, let's ignore that (but if that's the case in the original code, it could actually result in the exact problem you're describing because there won't be a concatenate or join on the date field since it's not spelled the same). &lt;/P&gt;
&lt;P&gt;One thing I'd try and check is the consistency of the date fields - in one case you are applying Date() to it and in another you're just using MonthEnd, and in the third you're just using AddYears(). I'd recommend using the same approach for all three and see if that gets them on the same page. I'm not sure if it's related, but without access to the data or a clear understanding of what's happening behind the scenes (for example, what is the "Previous Year" field in your table that's not in your script?) it's hard to guess what the issue might be.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Apr 2022 10:14:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Reporting-Service-Alerting/AddYears-function-doesn-t-work-properly-with-Concatenate/m-p/1917373#M150</guid>
      <dc:creator>Or</dc:creator>
      <dc:date>2022-04-12T10:14:25Z</dc:date>
    </item>
    <item>
      <title>Re: AddYears() function doesn't work properly with Concatenate</title>
      <link>https://community.qlik.com/t5/Reporting-Service-Alerting/AddYears-function-doesn-t-work-properly-with-Concatenate/m-p/1917564#M151</link>
      <description>&lt;P&gt;Are you trying to create additional rows for "last year" or additional fields in the existing rows?&lt;/P&gt;
&lt;P&gt;-Rob&lt;/P&gt;</description>
      <pubDate>Tue, 12 Apr 2022 16:13:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Reporting-Service-Alerting/AddYears-function-doesn-t-work-properly-with-Concatenate/m-p/1917564#M151</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2022-04-12T16:13:12Z</dc:date>
    </item>
  </channel>
</rss>

