<?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: UPR_RELEASED in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/UPR-RELEASED/m-p/1592398#M739264</link>
    <description>&lt;P&gt;Hi, this code can do the task. Sample attached.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;// Load Excel data using cross table to read each month as a different row (instead of columns)
ExcelData:
CrossTable(Date, Days, 4)
LOAD F1 as REF_NO, 
     F2 as FROM_DATE, 
     F3 as TO_DATE, 
     F4 as GROSS, 
     *
FROM
[.\SAMPLE.xls]
(biff, embedded labels, header is 1 lines, table is Sheet1$, filters(
Remove(Row, RowCnd(CellValue, 1, StrCnd(contain, 'REF_NO'))), // Remove row 4
Remove(Row, RowCnd(CellValue, 5, StrCnd(contain, 'vprior_month'))), // Remove row 3
Remove(Row, RowCnd(Compound, // Remove row 8
	RowCnd(CellValue, 1, StrCnd(null)),
	RowCnd(CellValue, 5, StrCnd(null))
))
));

// Mapping to retrieve total days
mapTotal:
Mapping LOAD REF_NO, Days
Resident ExcelData where Date='F17'; // 4 dimensions+12 months-&amp;gt;next column (17) is for totals

// Table with distributed amount
FinalTable:
LOAD *,
	 Date#(Date,'DD/MM/YYYY') as DateAsDate, // Original date field is loaded as a text, this field can be used for date operations
	 GROSS*Days/ApplyMap('mapTotal', REF_NO) as DistributedAmount
Resident ExcelData where IsNum(Date#(Date,'DD/MM/YYYY')); // Keep data from columns with a date in row 2

// Delete first table
DROP Table ExcelData;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 17 Jun 2019 07:34:40 GMT</pubDate>
    <dc:creator>rubenmarin</dc:creator>
    <dc:date>2019-06-17T07:34:40Z</dc:date>
    <item>
      <title>UPR_RELEASED</title>
      <link>https://community.qlik.com/t5/QlikView/UPR-RELEASED/m-p/1592360#M739263</link>
      <description>&lt;P&gt;Dear All,&lt;/P&gt;&lt;P&gt;I WANT TO DISTRIBUTE THE GROSS AMOUNT IN OVER THE YEAR USING ENTITLEMENT OF THE NO OF DAYS PLEASE FIND THE ATTACHMENT AND HELP ME.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;sagara&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/UPR-RELEASED/m-p/1592360#M739263</guid>
      <dc:creator>sagaraperera</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: UPR_RELEASED</title>
      <link>https://community.qlik.com/t5/QlikView/UPR-RELEASED/m-p/1592398#M739264</link>
      <description>&lt;P&gt;Hi, this code can do the task. Sample attached.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;// Load Excel data using cross table to read each month as a different row (instead of columns)
ExcelData:
CrossTable(Date, Days, 4)
LOAD F1 as REF_NO, 
     F2 as FROM_DATE, 
     F3 as TO_DATE, 
     F4 as GROSS, 
     *
FROM
[.\SAMPLE.xls]
(biff, embedded labels, header is 1 lines, table is Sheet1$, filters(
Remove(Row, RowCnd(CellValue, 1, StrCnd(contain, 'REF_NO'))), // Remove row 4
Remove(Row, RowCnd(CellValue, 5, StrCnd(contain, 'vprior_month'))), // Remove row 3
Remove(Row, RowCnd(Compound, // Remove row 8
	RowCnd(CellValue, 1, StrCnd(null)),
	RowCnd(CellValue, 5, StrCnd(null))
))
));

// Mapping to retrieve total days
mapTotal:
Mapping LOAD REF_NO, Days
Resident ExcelData where Date='F17'; // 4 dimensions+12 months-&amp;gt;next column (17) is for totals

// Table with distributed amount
FinalTable:
LOAD *,
	 Date#(Date,'DD/MM/YYYY') as DateAsDate, // Original date field is loaded as a text, this field can be used for date operations
	 GROSS*Days/ApplyMap('mapTotal', REF_NO) as DistributedAmount
Resident ExcelData where IsNum(Date#(Date,'DD/MM/YYYY')); // Keep data from columns with a date in row 2

// Delete first table
DROP Table ExcelData;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2019 07:34:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/UPR-RELEASED/m-p/1592398#M739264</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2019-06-17T07:34:40Z</dc:date>
    </item>
  </channel>
</rss>

