<?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 Display all data from the same loading based on a shift. in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Display-all-data-from-the-same-loading-based-on-a-shift/m-p/2091156#M89441</link>
    <description>&lt;P&gt;Hello, I'm having difficulties with a solution for displaying some data. Let me explain my problem.&lt;/P&gt;
&lt;P&gt;I need to display a timeline of events that occur during a truck's loading process at the factory. However, some events can repeat, and my main piece of information is the occurrence called "Truck released for entry into the factory." From this point onwards, I need all information with the same loading code to appear in the same shift. If my main piece of information indicates that it's in Shift C, I need the rest to be displayed in Shift C, regardless of the shift in which it ended.&lt;/P&gt;
&lt;P&gt;If I haven't explained it clearly, please let me know, and I'll try again.&lt;/P&gt;</description>
    <pubDate>Thu, 06 Jul 2023 14:37:43 GMT</pubDate>
    <dc:creator>Gabriel-Albuquerque</dc:creator>
    <dc:date>2023-07-06T14:37:43Z</dc:date>
    <item>
      <title>Display all data from the same loading based on a shift.</title>
      <link>https://community.qlik.com/t5/App-Development/Display-all-data-from-the-same-loading-based-on-a-shift/m-p/2091156#M89441</link>
      <description>&lt;P&gt;Hello, I'm having difficulties with a solution for displaying some data. Let me explain my problem.&lt;/P&gt;
&lt;P&gt;I need to display a timeline of events that occur during a truck's loading process at the factory. However, some events can repeat, and my main piece of information is the occurrence called "Truck released for entry into the factory." From this point onwards, I need all information with the same loading code to appear in the same shift. If my main piece of information indicates that it's in Shift C, I need the rest to be displayed in Shift C, regardless of the shift in which it ended.&lt;/P&gt;
&lt;P&gt;If I haven't explained it clearly, please let me know, and I'll try again.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jul 2023 14:37:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Display-all-data-from-the-same-loading-based-on-a-shift/m-p/2091156#M89441</guid>
      <dc:creator>Gabriel-Albuquerque</dc:creator>
      <dc:date>2023-07-06T14:37:43Z</dc:date>
    </item>
    <item>
      <title>Re: Display all data from the same loading based on a shift.</title>
      <link>https://community.qlik.com/t5/App-Development/Display-all-data-from-the-same-loading-based-on-a-shift/m-p/2091813#M89492</link>
      <description>&lt;P&gt;Hi, you can use a mapping table that stores the first shift for each loading code with that ocurrence. And use this mapping table to assign the shift instead of loading it.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;mapShift:
Mapping LOAD LoadingCode, Shift
From Table
Where occurrence="TheText"
Order by Loadingcode, Sequence;

Data:
LOAD 
  Field1,
  Field2,...
  ApplyMap(mapShift,LoadingCode) as Shift
From Table;&lt;/LI-CODE&gt;</description>
      <pubDate>Sun, 09 Jul 2023 07:17:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Display-all-data-from-the-same-loading-based-on-a-shift/m-p/2091813#M89492</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2023-07-09T07:17:08Z</dc:date>
    </item>
    <item>
      <title>Re: Display all data from the same loading based on a shift.</title>
      <link>https://community.qlik.com/t5/App-Development/Display-all-data-from-the-same-loading-based-on-a-shift/m-p/2092489#M89547</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;you can add a field in the load script that checks if the event is equal to "Truck cleared for entry" and then assigns either way the original shift or the shift in which the truck was cleared.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Assuming that the data is loaded in the correct chronological order, this example assigns the shift based on your requirements.&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;Test:
Load *,
	If(Event = 'Truck cleared for entry', Shift, Peek(Assigned_Shift)) as Assigned_Shift
;
Load * Inline [
Event, Sequence, Shift
Truck loaded, 1, A
Truck inspected, 2, A
Truck cleared for entry, 3, B
Truck at dock, 4, C
Truck unloaded, 5, C
Truck loaded, 6, C
Truck inspected, 7, C
Truck cleared for entry, 8, A
Truck at dock, 9, A
Truck unloaded, 10, A
];&lt;/LI-CODE&gt;
&lt;P&gt;Until the first 'Truck cleared for entry' value appears, the assigned shift will be null. You can easily replace a null value in the &lt;EM&gt;Assigned_Shift&lt;/EM&gt; field with the original &lt;EM&gt;Shift&lt;/EM&gt; value, in case that would matter.&lt;/P&gt;
&lt;P&gt;The result of my test table looks as follows:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tealowk_0-1689070442986.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/111973iEA9A9B8E9C9CC240/image-size/medium?v=v2&amp;amp;px=400" role="button" title="tealowk_0-1689070442986.png" alt="tealowk_0-1689070442986.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope that helps.&lt;/P&gt;
&lt;P&gt;Kind regards from Brussels,&lt;/P&gt;
&lt;P&gt;Thilo&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;</description>
      <pubDate>Tue, 11 Jul 2023 10:15:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Display-all-data-from-the-same-loading-based-on-a-shift/m-p/2092489#M89547</guid>
      <dc:creator>tealowk</dc:creator>
      <dc:date>2023-07-11T10:15:08Z</dc:date>
    </item>
    <item>
      <title>Re: Display all data from the same loading based on a shift.</title>
      <link>https://community.qlik.com/t5/App-Development/Display-all-data-from-the-same-loading-based-on-a-shift/m-p/2093213#M89595</link>
      <description>&lt;P&gt;Hi Ruben, thank you so much for explaining, that really solved my problem. Big hug!&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jul 2023 16:24:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Display-all-data-from-the-same-loading-based-on-a-shift/m-p/2093213#M89595</guid>
      <dc:creator>Gabriel-Albuquerque</dc:creator>
      <dc:date>2023-07-12T16:24:30Z</dc:date>
    </item>
  </channel>
</rss>

