<?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: Left Join within a single Table? in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Left-Join-within-a-single-Table/m-p/1684559#M52146</link>
    <description>&lt;P&gt;1) I think because you are grouping by OverallStatus. You are basically saying, give me these 4 fields for every distinct value in OverallStatus. So you're making this table:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;TABLE width="97.76609724047306%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="12.5%"&gt;OverallStatus&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/TD&gt;&lt;TD width="12.5%"&gt;&lt;P&gt;TimeStamp&lt;/P&gt;&lt;/TD&gt;&lt;TD width="25%"&gt;&lt;P&gt;WT.Overdue&lt;/P&gt;&lt;/TD&gt;&lt;TD width="25%"&gt;&lt;P&gt;WT.Open&lt;/P&gt;&lt;/TD&gt;&lt;TD width="25%"&gt;&lt;P&gt;WT.Closed&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="12.5%"&gt;&lt;P&gt;Overdue&lt;/P&gt;&lt;/TD&gt;&lt;TD width="12.5%"&gt;&lt;P&gt;12.03.2020 21:05:45&lt;/P&gt;&lt;/TD&gt;&lt;TD width="25%"&gt;&lt;P&gt;38&lt;/P&gt;&lt;/TD&gt;&lt;TD width="25%"&gt;&lt;P&gt;-&lt;/P&gt;&lt;/TD&gt;&lt;TD width="25%"&gt;&lt;P&gt;-&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="12.5%"&gt;&lt;P&gt;Open&lt;/P&gt;&lt;/TD&gt;&lt;TD width="12.5%"&gt;&lt;P&gt;12.03.2020 21:05:45&lt;/P&gt;&lt;/TD&gt;&lt;TD width="25%"&gt;&lt;P&gt;-&lt;/P&gt;&lt;/TD&gt;&lt;TD width="25%"&gt;&lt;P&gt;102&lt;/P&gt;&lt;/TD&gt;&lt;TD width="25%"&gt;&lt;P&gt;-&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="12.5%"&gt;&lt;P&gt;Closed&lt;/P&gt;&lt;/TD&gt;&lt;TD width="12.5%"&gt;&lt;P&gt;12.03.2020 21:05:45&lt;/P&gt;&lt;/TD&gt;&lt;TD width="25%"&gt;&lt;P&gt;-&lt;/P&gt;&lt;/TD&gt;&lt;TD width="25%"&gt;&lt;P&gt;-&lt;/P&gt;&lt;/TD&gt;&lt;TD width="25%"&gt;&lt;P&gt;573&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Except you can't see OverallStatus, as you did not load this as a field. But I think you can see now why every TimeStamp is tripled and you get nulls in the Overdue/Open/Closed columns.&lt;/P&gt;&lt;P&gt;2) To fix this, you will have to group by the TimeStamp field instead.&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;</description>
    <pubDate>Fri, 13 Mar 2020 16:32:32 GMT</pubDate>
    <dc:creator>jensmunnichs</dc:creator>
    <dc:date>2020-03-13T16:32:32Z</dc:date>
    <item>
      <title>Left Join within a single Table?</title>
      <link>https://community.qlik.com/t5/App-Development/Left-Join-within-a-single-Table/m-p/1684554#M52145</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;I'm trying to figure out how I can adjust the below load script to flatten the data into a single row.&amp;nbsp; I thought what I needed was &lt;A href="https://help.qlik.com/en-US/qlikview/April2019/Subsystems/Client/Content/QV_QlikView/Scripting/ScriptPrefixes/Left.htm" target="_blank"&gt;Left Join&lt;/A&gt;, but that seems to not be making any difference as I'm not joining tables, the data I'm trying to flatten already is in a single table. I don't want to combine the text into a single field, so Concat is out.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Reading the information on &lt;A href="https://community.qlik.com/t5/Qlik-Design-Blog/The-Crosstable-Load/ba-p/1468083" target="_blank"&gt;CrossTable&lt;/A&gt; and &lt;A href="https://community.qlik.com/t5/Qlik-Design-Blog/The-Generic-Load/ba-p/1473470" target="_blank"&gt;Generic&lt;/A&gt;, those as well don't appear to be what I need.&amp;nbsp; I tried specifying &lt;A href="https://help.qlik.com/en-US/qlikview/April2019/Subsystems/Client/Content/QV_QlikView/Scripting/DateAndTimeFunctions/now.htm" target="_blank"&gt;now()&lt;/A&gt;, thinking there was a change in the variable, but that doesn't seem to be the case.&lt;/P&gt;&lt;P&gt;I found a few previous articles related to merging information, but my end goad is not to concat data into a single cell, or use Generic/CrossTable to switch rows/columns.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's the load script I'm working with in QlikSense Enterprise.&amp;nbsp; The Table Request ID is a sharepoint site, so there is no concern with needing Distinct, as their IDs are always Distinct.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Let vDateStamp = now(0);
WeeklyTotals:
 Load
	('$(vDateStamp)') as TimeStamp, 
    	if(OverallStatus='Overdue',count([Request ID])) as WT.Overdue,
		if(OverallStatus='Open',count([Request ID])) as WT.Open,
		if(OverallStatus='Closed',count([Request ID])) as WT.Closed 
    Resident [Request Site] Group By OverallStatus;
Drop Field OverallStatus;&lt;/LI-CODE&gt;&lt;P&gt;The end result is:&lt;BR /&gt;&lt;STRONG&gt;WeeklyTotals&lt;/STRONG&gt;&lt;/P&gt;&lt;TABLE width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="25%"&gt;&lt;P&gt;TimeStamp&lt;/P&gt;&lt;/TD&gt;&lt;TD width="25%"&gt;&lt;P&gt;WT.Overdue&lt;/P&gt;&lt;/TD&gt;&lt;TD width="25%"&gt;&lt;P&gt;WT.Open&lt;/P&gt;&lt;/TD&gt;&lt;TD width="25%"&gt;&lt;P&gt;WT.Closed&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="25%"&gt;&lt;P&gt;12.03.2020 21:05:45&lt;/P&gt;&lt;/TD&gt;&lt;TD width="25%"&gt;&lt;P&gt;38&lt;/P&gt;&lt;/TD&gt;&lt;TD width="25%"&gt;&lt;P&gt;-&lt;/P&gt;&lt;/TD&gt;&lt;TD width="25%"&gt;&lt;P&gt;-&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="25%"&gt;&lt;P&gt;12.03.2020 21:05:45&lt;/P&gt;&lt;/TD&gt;&lt;TD width="25%"&gt;&lt;P&gt;-&lt;/P&gt;&lt;/TD&gt;&lt;TD width="25%"&gt;&lt;P&gt;102&lt;/P&gt;&lt;/TD&gt;&lt;TD width="25%"&gt;&lt;P&gt;-&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="25%"&gt;&lt;P&gt;12.03.2020 21:05:45&lt;/P&gt;&lt;/TD&gt;&lt;TD width="25%"&gt;&lt;P&gt;-&lt;/P&gt;&lt;/TD&gt;&lt;TD width="25%"&gt;&lt;P&gt;-&lt;/P&gt;&lt;/TD&gt;&lt;TD width="25%"&gt;&lt;P&gt;573&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;The end result I'm trying to get to is this:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;TimeStamp&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;WT.Overdue&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;WT.Open&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;WT.Closed&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;12.03.2020 21:05:45&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;38&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;102&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;573&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I ask this as step 2 is to schedule this in script in QMC to run once a week and &lt;A href="https://help.qlik.com/en-US/sense/November2018/Subsystems/Hub/Content/Sense_Hub/LoadData/use-QVD-files-incremental-load.htm" target="_blank"&gt;Insert Only&lt;/A&gt; to the existing table, resulting in a slow growing table that roughly looks like this:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;TimeStamp&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;WT.Overdue&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;WT.Open&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;WT.Closed&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;12.03.2020 21:05:45&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;38&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;102&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;573&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;19.03.2020 21:05:40&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;20&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;89&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;605&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;26.03.2020 21:06:14&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;22&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;41&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;653&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My Questions:&lt;/P&gt;&lt;P&gt;1) Why is it creating three timestamps and a value for each field? I was thinking since it's a single load, it would be a single row, but this is not the case.&lt;/P&gt;&lt;P&gt;2) How do I, using the field TimeStamp, merge the there rows into a single row?&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 18:56:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Left-Join-within-a-single-Table/m-p/1684554#M52145</guid>
      <dc:creator>SCruise</dc:creator>
      <dc:date>2024-11-16T18:56:41Z</dc:date>
    </item>
    <item>
      <title>Re: Left Join within a single Table?</title>
      <link>https://community.qlik.com/t5/App-Development/Left-Join-within-a-single-Table/m-p/1684559#M52146</link>
      <description>&lt;P&gt;1) I think because you are grouping by OverallStatus. You are basically saying, give me these 4 fields for every distinct value in OverallStatus. So you're making this table:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;TABLE width="97.76609724047306%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="12.5%"&gt;OverallStatus&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/TD&gt;&lt;TD width="12.5%"&gt;&lt;P&gt;TimeStamp&lt;/P&gt;&lt;/TD&gt;&lt;TD width="25%"&gt;&lt;P&gt;WT.Overdue&lt;/P&gt;&lt;/TD&gt;&lt;TD width="25%"&gt;&lt;P&gt;WT.Open&lt;/P&gt;&lt;/TD&gt;&lt;TD width="25%"&gt;&lt;P&gt;WT.Closed&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="12.5%"&gt;&lt;P&gt;Overdue&lt;/P&gt;&lt;/TD&gt;&lt;TD width="12.5%"&gt;&lt;P&gt;12.03.2020 21:05:45&lt;/P&gt;&lt;/TD&gt;&lt;TD width="25%"&gt;&lt;P&gt;38&lt;/P&gt;&lt;/TD&gt;&lt;TD width="25%"&gt;&lt;P&gt;-&lt;/P&gt;&lt;/TD&gt;&lt;TD width="25%"&gt;&lt;P&gt;-&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="12.5%"&gt;&lt;P&gt;Open&lt;/P&gt;&lt;/TD&gt;&lt;TD width="12.5%"&gt;&lt;P&gt;12.03.2020 21:05:45&lt;/P&gt;&lt;/TD&gt;&lt;TD width="25%"&gt;&lt;P&gt;-&lt;/P&gt;&lt;/TD&gt;&lt;TD width="25%"&gt;&lt;P&gt;102&lt;/P&gt;&lt;/TD&gt;&lt;TD width="25%"&gt;&lt;P&gt;-&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="12.5%"&gt;&lt;P&gt;Closed&lt;/P&gt;&lt;/TD&gt;&lt;TD width="12.5%"&gt;&lt;P&gt;12.03.2020 21:05:45&lt;/P&gt;&lt;/TD&gt;&lt;TD width="25%"&gt;&lt;P&gt;-&lt;/P&gt;&lt;/TD&gt;&lt;TD width="25%"&gt;&lt;P&gt;-&lt;/P&gt;&lt;/TD&gt;&lt;TD width="25%"&gt;&lt;P&gt;573&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Except you can't see OverallStatus, as you did not load this as a field. But I think you can see now why every TimeStamp is tripled and you get nulls in the Overdue/Open/Closed columns.&lt;/P&gt;&lt;P&gt;2) To fix this, you will have to group by the TimeStamp field instead.&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;</description>
      <pubDate>Fri, 13 Mar 2020 16:32:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Left-Join-within-a-single-Table/m-p/1684559#M52146</guid>
      <dc:creator>jensmunnichs</dc:creator>
      <dc:date>2020-03-13T16:32:32Z</dc:date>
    </item>
    <item>
      <title>Re: Left Join within a single Table?</title>
      <link>https://community.qlik.com/t5/App-Development/Left-Join-within-a-single-Table/m-p/1684597#M52147</link>
      <description>&lt;P&gt;Okay, that makes sense.&amp;nbsp; I was indeed able to confirm that is exactly what is happening; There is a line for each status as you show in your table. Your post lead me down a rabbit hole, which I'll post my end result below encase someone comes across this in the future.&lt;/P&gt;&lt;P&gt;Grouping by TimeStamp makes sense. It seems like I'll need a interim table to make that work since TimeStamp is define in the above load script and thus I cannot: Resident Load [Request Site] Group By OverallStatus, TimeStamp;&lt;/P&gt;&lt;P&gt;The issue becomes trying to group by without an Aggregate Function.&amp;nbsp; I only have a single timestamp, so&amp;nbsp;&lt;SPAN&gt;Only(TimeStamp) sould work, but that returned an error when using the following:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Let vDateStamp = now(0);
WeeklyTotals:
Load
	('$(vDateStamp)') as TimeStamp, 
    if(OverallStatus='Overdue',count([Request ID])) as WT.Overdue,
	if(OverallStatus='Open',count([Request ID])) as WT.Open,
    if(OverallStatus='Closed',count([Request ID])) as WT.Closed 
    Resident [Request Site] Group By OverallStatus;
Drop Field OverallStatus;

WeeklyTotalsInOneRow:
Load Only(TimeStamp),
	[WT.Overdue],
    [WT.Open],
    [WT.Closed]
Resident WeeklyTotals group by TimeStamp;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This was a pain in the side until I came across &lt;A href="https://community.qlik.com/t5/QlikView-Scripting/GROUP-BY-requires-ALL-fields/td-p/381748" target="_self"&gt;this post,&lt;/A&gt; which lead me to adjust the second table to:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;WeeklyTotalsInOneRow:
Load Only(TimeStamp),
	Only([WT.Overdue]),
    Only([WT.Open]),
    Only([WT.Closed])
Resident WeeklyTotals group by TimeStamp;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Works like a charm, Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Mar 2020 18:52:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Left-Join-within-a-single-Table/m-p/1684597#M52147</guid>
      <dc:creator>SCruise</dc:creator>
      <dc:date>2020-03-13T18:52:29Z</dc:date>
    </item>
    <item>
      <title>Re: Left Join within a single Table?</title>
      <link>https://community.qlik.com/t5/App-Development/Left-Join-within-a-single-Table/m-p/1684617#M52149</link>
      <description>you would need to group by timestamp not Overall Status</description>
      <pubDate>Fri, 13 Mar 2020 20:19:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Left-Join-within-a-single-Table/m-p/1684617#M52149</guid>
      <dc:creator>andrew_smith200</dc:creator>
      <dc:date>2020-03-13T20:19:09Z</dc:date>
    </item>
  </channel>
</rss>

