<?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: Current Year Vs Prior Year Script in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Current-Year-Vs-Prior-Year-Script/m-p/1596280#M43893</link>
    <description>&lt;P&gt;Oh, I think I misslead you, you don't have to do monthly adjustments with my solution.&lt;/P&gt;&lt;P&gt;You should replace the part below with your own data, the script reading file names. I just used an inline[]&amp;nbsp; as simple way to show you the concept.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="php"&gt;Data:
LOAD 
  Period , 
  Year 
INLINE [
  Period, Year
  Mar, 2019
  Apr, 2019
  Feb, 2018
  Jul, 2017
];&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 26 Jun 2019 12:58:54 GMT</pubDate>
    <dc:creator>Vegar</dc:creator>
    <dc:date>2019-06-26T12:58:54Z</dc:date>
    <item>
      <title>Current Year Vs Prior Year Script</title>
      <link>https://community.qlik.com/t5/App-Development/Current-Year-Vs-Prior-Year-Script/m-p/1596175#M43881</link>
      <description>&lt;P&gt;Hiya,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm looking to add in the script a bit to categorise as prior year vs current year.&amp;nbsp;&lt;/P&gt;&lt;P&gt;So all my files are labelled the same With the differences being the Month and Year.&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I would like to be able to do is have Qliksense identify that the latest file in date is May 2019, and that is categorised as Current Year, and then have it find the one that's May 2018 and have that categorised as Prior Year so I can compare the two in multiple tables.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can't seem to find something a previous thread that works/gives me what I need, but I have got Qlik to recognise the May 2019 etc as a date and this is my script to do that.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Script.PNG" style="width: 949px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/14464iE704394C7301565D/image-size/large?v=v2&amp;amp;px=999" role="button" title="Script.PNG" alt="Script.PNG" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SJL snip.PNG" style="width: 135px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/14463iC67709520AD07172/image-size/large?v=v2&amp;amp;px=999" role="button" title="SJL snip.PNG" alt="SJL snip.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Please could someone help?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 20:34:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Current-Year-Vs-Prior-Year-Script/m-p/1596175#M43881</guid>
      <dc:creator>NemoAndStitch22</dc:creator>
      <dc:date>2024-11-16T20:34:48Z</dc:date>
    </item>
    <item>
      <title>Re: Current Year Vs Prior Year Script</title>
      <link>https://community.qlik.com/t5/App-Development/Current-Year-Vs-Prior-Year-Script/m-p/1596252#M43891</link>
      <description>&lt;P&gt;You could solve it like this:&lt;/P&gt;&lt;LI-CODE lang="php"&gt;map:
mapping LOAD * 
inline [
  A1, B1
  0, Current Year
  -1, Prior Year
];

Data:
LOAD 
  Period , 
  Year 
INLINE [
  Period, Year
  Mar, 2019
  Apr, 2019
  Feb, 2018
  Jul, 2017
];
JOIN LOAD 
  MAX(Year) as LatestYear 
RESIDENT 
  Data;

LEFT JOIN LOAD
  applymap('map',Year - LatestYear, null()) as RelYear,
  *
RESIDENT Data;
DROP FIELD LatestYear;&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 26 Jun 2019 12:27:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Current-Year-Vs-Prior-Year-Script/m-p/1596252#M43891</guid>
      <dc:creator>Vegar</dc:creator>
      <dc:date>2019-06-26T12:27:47Z</dc:date>
    </item>
    <item>
      <title>Re: Current Year Vs Prior Year Script</title>
      <link>https://community.qlik.com/t5/App-Development/Current-Year-Vs-Prior-Year-Script/m-p/1596267#M43892</link>
      <description>&lt;P&gt;Hi Vegar,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for this, but I'm not sure it will work in the long run, There will be data for every month going back to 2016 and I don't want to have to edit the script every month when this is run, especially as I might not be the one running it each time...&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there another way?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Megan&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jun 2019 12:43:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Current-Year-Vs-Prior-Year-Script/m-p/1596267#M43892</guid>
      <dc:creator>NemoAndStitch22</dc:creator>
      <dc:date>2019-06-26T12:43:04Z</dc:date>
    </item>
    <item>
      <title>Re: Current Year Vs Prior Year Script</title>
      <link>https://community.qlik.com/t5/App-Development/Current-Year-Vs-Prior-Year-Script/m-p/1596280#M43893</link>
      <description>&lt;P&gt;Oh, I think I misslead you, you don't have to do monthly adjustments with my solution.&lt;/P&gt;&lt;P&gt;You should replace the part below with your own data, the script reading file names. I just used an inline[]&amp;nbsp; as simple way to show you the concept.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="php"&gt;Data:
LOAD 
  Period , 
  Year 
INLINE [
  Period, Year
  Mar, 2019
  Apr, 2019
  Feb, 2018
  Jul, 2017
];&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jun 2019 12:58:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Current-Year-Vs-Prior-Year-Script/m-p/1596280#M43893</guid>
      <dc:creator>Vegar</dc:creator>
      <dc:date>2019-06-26T12:58:54Z</dc:date>
    </item>
    <item>
      <title>Re: Current Year Vs Prior Year Script</title>
      <link>https://community.qlik.com/t5/App-Development/Current-Year-Vs-Prior-Year-Script/m-p/1596289#M43895</link>
      <description>&lt;P&gt;Ah okay, gotcha thank you, when I do this, and adapt to my data it doesn't like the Year field...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Error.PNG" style="width: 324px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/14479i15876BECCFFB04F8/image-size/large?v=v2&amp;amp;px=999" role="button" title="Error.PNG" alt="Error.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Every time I have year written it's the same..&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you know why this would be?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jun 2019 13:15:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Current-Year-Vs-Prior-Year-Script/m-p/1596289#M43895</guid>
      <dc:creator>NemoAndStitch22</dc:creator>
      <dc:date>2019-06-26T13:15:59Z</dc:date>
    </item>
    <item>
      <title>Re: Current Year Vs Prior Year Script</title>
      <link>https://community.qlik.com/t5/App-Development/Current-Year-Vs-Prior-Year-Script/m-p/1596500#M44096</link>
      <description>It looks like you haven't managed to create a year field at the point you&lt;BR /&gt;are referring to it. I have no better guess without looking at your&lt;BR /&gt;script/data model.&lt;BR /&gt;&lt;BR /&gt;-Vegar&lt;BR /&gt;</description>
      <pubDate>Wed, 26 Jun 2019 21:33:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Current-Year-Vs-Prior-Year-Script/m-p/1596500#M44096</guid>
      <dc:creator>Vegar</dc:creator>
      <dc:date>2019-06-26T21:33:06Z</dc:date>
    </item>
  </channel>
</rss>

