<?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: Age Calculation in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Age-Calculation/m-p/1651719#M593443</link>
    <description>&lt;P&gt;Currently loading all files and saving that into QVD. I have to make just this calculation for the report.&lt;/P&gt;&lt;P&gt;all the fields are direct from file.&lt;/P&gt;</description>
    <pubDate>Wed, 27 Nov 2019 08:13:15 GMT</pubDate>
    <dc:creator>hitha1512</dc:creator>
    <dc:date>2019-11-27T08:13:15Z</dc:date>
    <item>
      <title>Age Calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Age-Calculation/m-p/1651217#M593435</link>
      <description>&lt;P&gt;Hi Team,&lt;/P&gt;&lt;P&gt;I have a requirement to calculate the Age.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Requirement -&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Compare field "Agreement Name" with last business days "Agreement Name" data. If new, then = 0, If was in the previous report, then +1 to the existing Days OLD count.&amp;nbsp;If the agreement name drops off the report and appears the next day the count would restart from 0 again.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;attaching raw data files and the results required.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Note : we receive daily files and there can be cases where we might not receive files&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks for your help in advance.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Hitha Dhani&lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2019 06:24:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Age-Calculation/m-p/1651217#M593435</guid>
      <dc:creator>hitha1512</dc:creator>
      <dc:date>2019-11-27T06:24:21Z</dc:date>
    </item>
    <item>
      <title>Re: Age Calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Age-Calculation/m-p/1651224#M593436</link>
      <description>&lt;P&gt;Hi Hitha,&lt;/P&gt;&lt;P&gt;Can you provide with the sample data.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Sujana&lt;/P&gt;</description>
      <pubDate>Tue, 26 Nov 2019 05:58:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Age-Calculation/m-p/1651224#M593436</guid>
      <dc:creator>sujana1621</dc:creator>
      <dc:date>2019-11-26T05:58:28Z</dc:date>
    </item>
    <item>
      <title>Re: Age Calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Age-Calculation/m-p/1651676#M593437</link>
      <description>&lt;P&gt;Hey thank you for responding. have attached the files. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2019 06:24:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Age-Calculation/m-p/1651676#M593437</guid>
      <dc:creator>hitha1512</dc:creator>
      <dc:date>2019-11-27T06:24:58Z</dc:date>
    </item>
    <item>
      <title>Re: Age Calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Age-Calculation/m-p/1651684#M593438</link>
      <description>&lt;P&gt;Hi Hitha,&lt;/P&gt;&lt;P&gt;Are you looking for a script solution or UI? What is your data load strategy?&lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2019 06:49:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Age-Calculation/m-p/1651684#M593438</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2019-11-27T06:49:08Z</dc:date>
    </item>
    <item>
      <title>Re: Age Calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Age-Calculation/m-p/1651687#M593439</link>
      <description>&lt;P&gt;Hi I am looking for script resolution.&amp;nbsp;&lt;/P&gt;&lt;P&gt;its just one single table(one file load per day).... with multiple fields. I have provided just 2 fields required for calculation.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2019 07:07:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Age-Calculation/m-p/1651687#M593439</guid>
      <dc:creator>hitha1512</dc:creator>
      <dc:date>2019-11-27T07:07:58Z</dc:date>
    </item>
    <item>
      <title>Re: Age Calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Age-Calculation/m-p/1651692#M593440</link>
      <description>&lt;P&gt;If you keep concatenating the table daily, it looks that by only &lt;STRONG&gt;counting&lt;/STRONG&gt; your country - you could the expected result. Let me know if I am missing anything.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2019 07:13:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Age-Calculation/m-p/1651692#M593440</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2019-11-27T07:13:54Z</dc:date>
    </item>
    <item>
      <title>Re: Age Calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Age-Calculation/m-p/1651707#M593441</link>
      <description>&lt;P&gt;Hi ,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't think that would work. Giving examples below&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;nbsp;&lt;STRONG&gt;Afghanistan&lt;/STRONG&gt; : Considering today to be 23rd, we will have to compare data to precious day 22nd. if present, Age has to be 1.&lt;/P&gt;&lt;P&gt;when we receive data on 24th, we will have to compare data to 23rd. if present Age will be +1 to the existing age which would be 1+1 =2.&lt;/P&gt;&lt;P&gt;So the Age for&amp;nbsp;Afghanistan on 24th will be 2. the age will keep incrementing by +1&amp;nbsp;&lt;/P&gt;&lt;P&gt;This increment will stop or come back to 0 when it does not find the record the previous day or same day&lt;/P&gt;&lt;P&gt;if on 25th we do not get Afghanistan. it drops off the record. if comes back on 26th, age would be 0. if comes back on 27th again, age will be 1.&lt;/P&gt;&lt;P&gt;I hope this is not confusing.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2019 07:37:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Age-Calculation/m-p/1651707#M593441</guid>
      <dc:creator>hitha1512</dc:creator>
      <dc:date>2019-11-27T07:37:45Z</dc:date>
    </item>
    <item>
      <title>Re: Age Calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Age-Calculation/m-p/1651712#M593442</link>
      <description>&lt;P&gt;Got it. However, would require a bit more explanation in load strategy. Are you using qvd to load the historical data or partial reload?&lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2019 07:56:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Age-Calculation/m-p/1651712#M593442</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2019-11-27T07:56:18Z</dc:date>
    </item>
    <item>
      <title>Re: Age Calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Age-Calculation/m-p/1651719#M593443</link>
      <description>&lt;P&gt;Currently loading all files and saving that into QVD. I have to make just this calculation for the report.&lt;/P&gt;&lt;P&gt;all the fields are direct from file.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2019 08:13:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Age-Calculation/m-p/1651719#M593443</guid>
      <dc:creator>hitha1512</dc:creator>
      <dc:date>2019-11-27T08:13:15Z</dc:date>
    </item>
    <item>
      <title>Re: Age Calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Age-Calculation/m-p/1651764#M593444</link>
      <description>&lt;P&gt;Try like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;temp:
LOAD valuation_date, 
     agreement_name
FROM
[Exposures_20191122.xlsx]
(ooxml, embedded labels, table is Sheet1);

LOAD valuation_date, 
     agreement_name
FROM
[Exposures_20191123.xlsx]
(ooxml, embedded labels, table is Sheet1);

LOAD valuation_date, 
     agreement_name
FROM
[Exposures_20191124.xlsx]
(ooxml, embedded labels, table is Sheet1);

t1:
	 
LOAD 
	*,
	If(peek(agreement_name)=agreement_name and Floor(valuation_date-Peek(valuation_date))=1, RangeSum(peek(Age),1),0) as Age
Resident	temp order by agreement_name,valuation_date;

Drop table temp;
Load
	Max(valuation_date) as MaxDate
Resident t1;
	
Let vMaxDate=Date(Peek('MaxDate'));

t2:
Load
	agreement_name,
	Age
Resident t1 where 	valuation_date='$(vMaxDate)';
Drop Table t1;&lt;/LI-CODE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 146px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/24517iF4B1FAABE789A8EB/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2019 09:30:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Age-Calculation/m-p/1651764#M593444</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2019-11-27T09:30:45Z</dc:date>
    </item>
    <item>
      <title>Re: Age Calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Age-Calculation/m-p/1651812#M593445</link>
      <description>&lt;P&gt;Fabulous ! thanks a ton for your quick response &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; Much appreciated !&lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2019 10:21:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Age-Calculation/m-p/1651812#M593445</guid>
      <dc:creator>hitha1512</dc:creator>
      <dc:date>2019-11-27T10:21:18Z</dc:date>
    </item>
    <item>
      <title>Re: Age Calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Age-Calculation/m-p/1672832#M593447</link>
      <description>&lt;P&gt;Hi Tresesco,&lt;/P&gt;&lt;P&gt;the below solution worked. but now i have been asked to exclude the Public holidays and weekends. please see my explanation below.&lt;/P&gt;&lt;P&gt;I receive excel files daily except on weekends and public holiday. so for these days i dont have the date populated in application.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please refer the attached screen shot. for 28/01/2020 the age expected is 1,&amp;nbsp; as 27th was public holiday and 25 and 26 were weekends. I do not have 25,26,27 populated in the dashboard.&amp;nbsp;&lt;/P&gt;&lt;P&gt;your code is checking for the previous day.&amp;nbsp;&lt;/P&gt;&lt;P&gt;-------Floor(valuation_date-Peek(valuation_date))=1,&lt;/P&gt;&lt;P&gt;what i want would be based on file. if the previous file that i received has the agreement name or not.&amp;nbsp;&lt;/P&gt;&lt;P&gt;would appreciate if you could help &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Hitha Dhani&lt;/P&gt;</description>
      <pubDate>Thu, 06 Feb 2020 09:23:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Age-Calculation/m-p/1672832#M593447</guid>
      <dc:creator>hitha1512</dc:creator>
      <dc:date>2020-02-06T09:23:04Z</dc:date>
    </item>
  </channel>
</rss>

