<?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: Join two transaction table to get aggregate value for each date [link table] in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Join-two-transaction-table-to-get-aggregate-value-for-each-date/m-p/1853903#M70503</link>
    <description>&lt;P&gt;Hi, I'm not sure to understand what you want, maybe it's somethinglike the canonical date, check and example here:&amp;nbsp;&lt;A href="https://community.qlik.com/t5/Qlik-Design-Blog/Canonical-Date/ba-p/1463578" target="_blank"&gt;https://community.qlik.com/t5/Qlik-Design-Blog/Canonical-Date/ba-p/1463578&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 31 Oct 2021 07:53:25 GMT</pubDate>
    <dc:creator>rubenmarin</dc:creator>
    <dc:date>2021-10-31T07:53:25Z</dc:date>
    <item>
      <title>Join two transaction table to get aggregate value for each date [link table]</title>
      <link>https://community.qlik.com/t5/App-Development/Join-two-transaction-table-to-get-aggregate-value-for-each-date/m-p/1853555#M70475</link>
      <description>&lt;P&gt;Hello All&lt;/P&gt;
&lt;P&gt;I am &lt;SPAN&gt;novice in the Qlik !&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I have two transactional tables with name ALX and DAT. Both Have duplicates dates .Both have two fields &lt;STRONG&gt;Line_haul and avg_line_haul_rate&lt;/STRONG&gt;&lt;/SPAN&gt; resp. I need to compare this two things in single tabular tables for specific date using master calender.&lt;/P&gt;
&lt;P&gt;But 1) In DAT table data is loaded on every thursday and monday. So I need that missing dates. Somehow i was able to get that. with prior avg_line_haul value resp.&lt;/P&gt;
&lt;P&gt;2) grouped by function is not working or maybe I can't do that&lt;/P&gt;
&lt;P&gt;please find attachments of datamodel ,load script, sample object and QVD&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Data model" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/65575iA8FF0C558A08D0AE/image-size/large?v=v2&amp;amp;px=999" role="button" title="alx and DAT datamodel.png" alt="Data model" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Data model&lt;/span&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tabular form" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/65576iDB82F2C6CB773C09/image-size/large?v=v2&amp;amp;px=999" role="button" title="alx and DAT.png" alt="tabular form" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;tabular form&lt;/span&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;LI-CODE lang="javascript"&gt;[ALX_INFO]:

LOAD 
ALX_MILES,
LINE_HAUL,
ACTUAL_PU_DATE,
date(ACTUAL_PU_DATE,'MM/DD/YYYY') as ACTUAL_PU_DATE1,
Date(Date(left(ACTUAL_PU_DATE,10)),'MM/DD/YYYY') as ALX_Date

From "lib://QlikSense (allenlund_nprinting)/QVD Repository\Extractor\Sales\[ALX_OFF_LOAD_HISTORY_INFO].QVD"
(qvd) 
where year(Floor(ACTUAL_PU_DATE))&amp;gt;year(AddYears(date(Today()-1),-2))
;




[DAT]:

LOAD
   
    RATE_DATE,   
   
    AVG_LINEHAUL_RATE,
   
    
Date(Floor(Date(Date#(RATE_DATE, 'YYYY/MM/DD hh:mm:ss'),'MM/DD/YYYY')),'MM/DD/YYYY') as Dat_Date
   
FROM [lib://QVD STORAGE (allenlund_nprinting)/DAT.QVD]
(qvd);


link_date_table:

load ALX_Date as Date //as ALX_Date1
resident ALX_INFO;

Load Dat_Date as Date //as Dat_Date2
Resident DAT;


link_date_table2:
Load Distinct
Date,


Date as ALX_Date,
Date as Dat_Date

Resident link_date_table;
///master calender
MinMaxTable:
Load 
Max(Dat_Date) as Maxdate,
Min(Dat_Date) as Mindate
Resident [DAT];

Let vMax= Peek('Maxdate',0,'MinMaxTable');
Let vMin= Peek('Mindate',0,'MinMaxTable');

Drop Table MinMaxTable;

Calender:
Load
date($(vMin) + RowNo()-1) as X
 AutoGenerate $(vMax) - $(vMin)+1;

 



Master_Calendar:
LOAD X AS Date,

X AS [%Calendar Date],
date(X,'MM/DD/YY (WWW)') AS [Calendar Date_Name],
Date(X,'MM/DD/YYYY') AS [Calendar Date1], 
day(X) AS [%Calendar Day],
Year(X) AS [%Calendar Year],
Month(X) AS [%Calendar Month],
Week(X) AS [%Calendar Week],
WeekDay(X) AS [%Calendar WeekDay],
MonthName(X) AS [Calendar Month_Name],
Num(Month(X)) AS [Calendar Month Num],
QuarterName(X) AS [Calendar QuarterName],
'Q'&amp;amp;Ceil(X/3) AS [%Calendar Quarter],
Date(MonthStart(X)) AS [Month Start],
Date(MonthEnd(X)) AS [Month End],
Date(QuarterStart(X)) AS [Quarter Start],
Date(QuarterEnd(X)) AS [Quarter End],
If(Month(X)&amp;lt;=3,Month(X)+9,Month(X)-3) AS [Fiscal Month Num],
Dual(Month(X),If(Month(X)&amp;lt;=3,Month(X)+9,Month(X)-3)) AS [Fiscal Month],
Year(Yearname(X,0,4))+1 AS [Fiscal Year],
Left(Year(Yearname(X,0,4)),5)&amp;amp;'-'&amp;amp;Right(Year(Yearname(X,0,4))+1,2) AS [FY Year Name]
 Resident Calender

 where (year(Floor(X))&amp;gt;= year(AddYears(date(Today()-1),-2)));


DROP Table Calender;&lt;/LI-CODE&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;Please help on this&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried my all possible ways&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;Bhagwat K&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Nov 2021 11:27:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Join-two-transaction-table-to-get-aggregate-value-for-each-date/m-p/1853555#M70475</guid>
      <dc:creator>Bhagwat09</dc:creator>
      <dc:date>2021-11-03T11:27:40Z</dc:date>
    </item>
    <item>
      <title>Re: Join two transaction table to get aggregate value for each date [link table]</title>
      <link>https://community.qlik.com/t5/App-Development/Join-two-transaction-table-to-get-aggregate-value-for-each-date/m-p/1853903#M70503</link>
      <description>&lt;P&gt;Hi, I'm not sure to understand what you want, maybe it's somethinglike the canonical date, check and example here:&amp;nbsp;&lt;A href="https://community.qlik.com/t5/Qlik-Design-Blog/Canonical-Date/ba-p/1463578" target="_blank"&gt;https://community.qlik.com/t5/Qlik-Design-Blog/Canonical-Date/ba-p/1463578&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 31 Oct 2021 07:53:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Join-two-transaction-table-to-get-aggregate-value-for-each-date/m-p/1853903#M70503</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2021-10-31T07:53:25Z</dc:date>
    </item>
  </channel>
</rss>

