<?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: concat distinct strings on load in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/concat-distinct-strings-on-load/m-p/1727510#M55449</link>
    <description>&lt;P&gt;With this simple example, this works, not sure if your real data is more complex..&lt;/P&gt;&lt;P&gt;temp:&lt;BR /&gt;load * inline&lt;BR /&gt;[&lt;BR /&gt;busRoute, sequence, activity, location, time&lt;BR /&gt;B1, 1, O, loc_A, 9:00&lt;BR /&gt;B1, 10, A, loc_B, 9:10&lt;BR /&gt;B1, 11, D, loc_B, 9:11&lt;BR /&gt;B1, 20, A, loc_C, 9:20&lt;BR /&gt;B1, 21, D, loc_C, 9:21&lt;BR /&gt;B1, 31, T, loc_D, 9:30&lt;BR /&gt;B2, 1, O, loc_P, 9:00&lt;BR /&gt;B2, 10, A, loc_Q, 10:10&lt;BR /&gt;B2, 11, D, loc_Q, 10:11&lt;BR /&gt;B2, 20, A, loc_R, 10:20&lt;BR /&gt;B2, 21, D, loc_R, 10:21&lt;BR /&gt;B2, 31, T, loc_S, 10:30&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;// O - Origin&lt;/P&gt;&lt;P&gt;// A - Arrival&lt;/P&gt;&lt;P&gt;// D - Departure&lt;/P&gt;&lt;P&gt;// T - Terminate&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Distinct:&lt;BR /&gt;Load distinct busRoute,&lt;BR /&gt;location as stop&lt;BR /&gt;Resident temp;&lt;/P&gt;&lt;P&gt;left Join(temp)&lt;BR /&gt;load busRoute,&lt;BR /&gt;concat(stop,'-') as stop_pattern&lt;BR /&gt;Resident Distinct&lt;BR /&gt;Group by busRoute;&lt;/P&gt;&lt;P&gt;Drop table Distinct;&lt;/P&gt;</description>
    <pubDate>Tue, 14 Jul 2020 02:13:20 GMT</pubDate>
    <dc:creator>Lisa_P</dc:creator>
    <dc:date>2020-07-14T02:13:20Z</dc:date>
    <item>
      <title>concat distinct strings on load</title>
      <link>https://community.qlik.com/t5/App-Development/concat-distinct-strings-on-load/m-p/1727504#M55447</link>
      <description>&lt;P&gt;I am trying to create a list of locations associated with each value in a column (eg stopping pattern for a bus route), but the data sometimes has each location twice recording the arrival and departure. I am currently getting the list correct, but it includes the location twice when it occurs twice in the data. I would only like to see the location once even if the data records the arrival and departure.&lt;/P&gt;&lt;P&gt;The order of the location is important as it describes the order of stops.&lt;/P&gt;&lt;P&gt;eg&lt;/P&gt;&lt;P&gt;temp:&lt;BR /&gt;load * inline&lt;BR /&gt;[&lt;BR /&gt;busRoute, sequence, activity, location, time&lt;BR /&gt;B1, 1, O, loc_A, 9:00&lt;BR /&gt;B1, 10, A, loc_B, 9:10&lt;BR /&gt;B1, 11, D, loc_B, 9:11&lt;BR /&gt;B1, 20, A, loc_C, 9:20&lt;BR /&gt;B1, 21, D, loc_C, 9:21&lt;BR /&gt;B1, 31, T, loc_D, 9:30&lt;BR /&gt;B2, 1, O, loc_P, 9:00&lt;BR /&gt;B2, 10, A, loc_Q, 10:10&lt;BR /&gt;B2, 11, D, loc_Q, 10:11&lt;BR /&gt;B2, 20, A, loc_R, 10:20&lt;BR /&gt;B2, 21, D, loc_R, 10:21&lt;BR /&gt;B2, 31, T, loc_S, 10:30&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;// O - Origin&lt;/P&gt;&lt;P&gt;// A - Arrival&lt;/P&gt;&lt;P&gt;// D - Departure&lt;/P&gt;&lt;P&gt;// T - Terminate&lt;/P&gt;&lt;P&gt;left Join&lt;BR /&gt;load busRoute,&lt;BR /&gt;concat(DISTINCT location,'-',sequence) as stop_pattern&lt;BR /&gt;Resident temp&lt;BR /&gt;Group by busRoute;&lt;/P&gt;&lt;P&gt;produces stopping patterns for&amp;nbsp;&lt;/P&gt;&lt;P&gt;B1: loc_A-loc_B-loc_B-loc_C-Loc_C-loc_D&lt;/P&gt;&lt;P&gt;B2: loc_P-loc_Q-loc_Q-loc_R-Loc_R-loc_S&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I'm looking for is:&lt;/P&gt;&lt;P&gt;B1: loc_A-loc_B-Loc_C-loc_D&lt;/P&gt;&lt;P&gt;B2: loc_P-loc_Q-loc_R-loc_S&lt;/P&gt;&lt;P&gt;Is there a way to achieve this?&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>Sat, 16 Nov 2024 18:22:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/concat-distinct-strings-on-load/m-p/1727504#M55447</guid>
      <dc:creator>beaubellamy</dc:creator>
      <dc:date>2024-11-16T18:22:32Z</dc:date>
    </item>
    <item>
      <title>Re: concat distinct strings on load</title>
      <link>https://community.qlik.com/t5/App-Development/concat-distinct-strings-on-load/m-p/1727510#M55449</link>
      <description>&lt;P&gt;With this simple example, this works, not sure if your real data is more complex..&lt;/P&gt;&lt;P&gt;temp:&lt;BR /&gt;load * inline&lt;BR /&gt;[&lt;BR /&gt;busRoute, sequence, activity, location, time&lt;BR /&gt;B1, 1, O, loc_A, 9:00&lt;BR /&gt;B1, 10, A, loc_B, 9:10&lt;BR /&gt;B1, 11, D, loc_B, 9:11&lt;BR /&gt;B1, 20, A, loc_C, 9:20&lt;BR /&gt;B1, 21, D, loc_C, 9:21&lt;BR /&gt;B1, 31, T, loc_D, 9:30&lt;BR /&gt;B2, 1, O, loc_P, 9:00&lt;BR /&gt;B2, 10, A, loc_Q, 10:10&lt;BR /&gt;B2, 11, D, loc_Q, 10:11&lt;BR /&gt;B2, 20, A, loc_R, 10:20&lt;BR /&gt;B2, 21, D, loc_R, 10:21&lt;BR /&gt;B2, 31, T, loc_S, 10:30&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;// O - Origin&lt;/P&gt;&lt;P&gt;// A - Arrival&lt;/P&gt;&lt;P&gt;// D - Departure&lt;/P&gt;&lt;P&gt;// T - Terminate&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Distinct:&lt;BR /&gt;Load distinct busRoute,&lt;BR /&gt;location as stop&lt;BR /&gt;Resident temp;&lt;/P&gt;&lt;P&gt;left Join(temp)&lt;BR /&gt;load busRoute,&lt;BR /&gt;concat(stop,'-') as stop_pattern&lt;BR /&gt;Resident Distinct&lt;BR /&gt;Group by busRoute;&lt;/P&gt;&lt;P&gt;Drop table Distinct;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jul 2020 02:13:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/concat-distinct-strings-on-load/m-p/1727510#M55449</guid>
      <dc:creator>Lisa_P</dc:creator>
      <dc:date>2020-07-14T02:13:20Z</dc:date>
    </item>
    <item>
      <title>Re: concat distinct strings on load</title>
      <link>https://community.qlik.com/t5/App-Development/concat-distinct-strings-on-load/m-p/1727514#M55452</link>
      <description>&lt;P&gt;Using Hierarchy.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;tab1:
Hierarchy(location, ParentLoc,Node,,location,,'-')
LOAD *, location As Node, If(activity&amp;lt;&amp;gt;'O',Peek(location)) As ParentLoc
Where activity &amp;lt;&amp;gt; 'A';
LOAD * INLINE [
busRoute, sequence, activity, location, time
B1, 1, O, loc_A, 9:00
B1, 10, A, loc_B, 9:10
B1, 11, D, loc_B, 9:11
B1, 20, A, loc_C, 9:20
B1, 21, D, loc_C, 9:21
B1, 31, T, loc_D, 9:30
B2, 1, O, loc_P, 9:00
B2, 10, A, loc_Q, 10:10
B2, 11, D, loc_Q, 10:11
B2, 20, A, loc_R, 10:20
B2, 21, D, loc_R, 10:21
B2, 31, T, loc_S, 10:30
];

tab2:
NoConcatenate
LOAD busRoute&amp;amp;':'&amp;amp;Path As Output
Resident tab1
Where activity = 'T';

Drop Table tab1;&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 14 Jul 2020 02:48:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/concat-distinct-strings-on-load/m-p/1727514#M55452</guid>
      <dc:creator>Saravanan_Desingh</dc:creator>
      <dc:date>2020-07-14T02:48:42Z</dc:date>
    </item>
    <item>
      <title>Re: concat distinct strings on load</title>
      <link>https://community.qlik.com/t5/App-Development/concat-distinct-strings-on-load/m-p/1727517#M55453</link>
      <description>&lt;P&gt;Output.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="commQV43.PNG" style="width: 475px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/37385iF7B49362BFF6F154/image-size/large?v=v2&amp;amp;px=999" role="button" title="commQV43.PNG" alt="commQV43.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="commQV44.PNG" style="width: 146px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/37386iFDEBB65643B9A3D0/image-size/large?v=v2&amp;amp;px=999" role="button" title="commQV44.PNG" alt="commQV44.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jul 2020 02:50:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/concat-distinct-strings-on-load/m-p/1727517#M55453</guid>
      <dc:creator>Saravanan_Desingh</dc:creator>
      <dc:date>2020-07-14T02:50:29Z</dc:date>
    </item>
    <item>
      <title>Re: concat distinct strings on load</title>
      <link>https://community.qlik.com/t5/App-Development/concat-distinct-strings-on-load/m-p/1727528#M55454</link>
      <description>&lt;P&gt;This one doesn't quite work the way i was hoping. The example may have just been a bit too simple.&lt;/P&gt;&lt;P&gt;If we reverse the location labels of one bus route (B1), the sequence is in alphabetical order, and i need it in the order of sequence. I added sequence to the distinct load, but that just allows the duplicate label to be seen as a distinct label because it has a distinct sequence number.&lt;/P&gt;&lt;P&gt;temp:&lt;BR /&gt;load * inline&lt;BR /&gt;[&lt;BR /&gt;busRoute, sequence, activity, location, time&lt;BR /&gt;B1, 1, O, loc_D, 9:00&lt;BR /&gt;B1, 10, A, loc_C, 9:10&lt;BR /&gt;B1, 11, D, loc_C, 9:11&lt;BR /&gt;B1, 20, A, loc_B, 9:20&lt;BR /&gt;B1, 21, D, loc_B, 9:21&lt;BR /&gt;B1, 31, T, loc_A, 9:30&lt;BR /&gt;B2, 1, O, loc_P, 9:00&lt;BR /&gt;B2, 10, A, loc_Q, 10:10&lt;BR /&gt;B2, 11, D, loc_Q, 10:11&lt;BR /&gt;B2, 20, A, loc_R, 10:20&lt;BR /&gt;B2, 21, D, loc_R, 10:21&lt;BR /&gt;B2, 31, T, loc_S, 10:30&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In this example the desired output is:&lt;/P&gt;&lt;P&gt;B1: loc_D-loc_C-loc_B-loc_A&lt;/P&gt;&lt;P&gt;B2: loc_P-loc_Q-loc_R-loc_S&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jul 2020 05:45:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/concat-distinct-strings-on-load/m-p/1727528#M55454</guid>
      <dc:creator>beaubellamy</dc:creator>
      <dc:date>2020-07-14T05:45:29Z</dc:date>
    </item>
    <item>
      <title>Re: concat distinct strings on load</title>
      <link>https://community.qlik.com/t5/App-Development/concat-distinct-strings-on-load/m-p/1727720#M55472</link>
      <description>&lt;P&gt;Can you check this?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;temp:
load * inline
[
busRoute, sequence, activity, location, time
B1, 1, O, loc_D, 9:00
B1, 10, A, loc_C, 9:10
B1, 11, D, loc_C, 9:11
B1, 20, A, loc_B, 9:20
B1, 21, D, loc_B, 9:21
B1, 31, T, loc_A, 9:30
B2, 1, O, loc_P, 9:00
B2, 10, A, loc_Q, 10:10
B2, 11, D, loc_Q, 10:11
B2, 20, A, loc_R, 10:20
B2, 21, D, loc_R, 10:21
B2, 31, T, loc_S, 10:30
];

Left Join(temp)
LOAD busRoute, Concat(DISTINCT If(activity &amp;lt;&amp;gt; 'A',location),'-',sequence) As Path
Resident temp
Group By busRoute
;&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 14 Jul 2020 14:05:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/concat-distinct-strings-on-load/m-p/1727720#M55472</guid>
      <dc:creator>Saravanan_Desingh</dc:creator>
      <dc:date>2020-07-14T14:05:24Z</dc:date>
    </item>
  </channel>
</rss>

