<?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: Load distinct routes and then route steps using subfield in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Load-distinct-routes-and-then-route-steps-using-subfield/m-p/1817397#M66950</link>
    <description>&lt;P&gt;Still not giving the intended result and I think it has to do with not getting distinct order routes loaded. The maximum number of steps in any of the routes is 9 and I have RouteStepNum values up to 36.&lt;/P&gt;&lt;P&gt;[OrderRouteBreakdown]:&lt;BR /&gt;LOAD DISTINCT&lt;BR /&gt;OrderRoute,&lt;BR /&gt;OrderRouteStep,&lt;BR /&gt;IF(OrderRoute=Previous(OrderRoute), Rangesum(Peek('OrderRouteStepNum'), 1), 1) as OrderRouteStepNum;&lt;BR /&gt;LOAD&lt;BR /&gt;OrderRoute,&lt;BR /&gt;TRIM(Subfield(OrderRoute,',')) as OrderRouteStep&lt;BR /&gt;RESIDENT [OrderDueDates];&lt;/P&gt;</description>
    <pubDate>Wed, 23 Jun 2021 14:20:13 GMT</pubDate>
    <dc:creator>SDT</dc:creator>
    <dc:date>2021-06-23T14:20:13Z</dc:date>
    <item>
      <title>Load distinct routes and then route steps using subfield</title>
      <link>https://community.qlik.com/t5/App-Development/Load-distinct-routes-and-then-route-steps-using-subfield/m-p/1817321#M66934</link>
      <description>&lt;P&gt;Hello.&lt;/P&gt;&lt;P&gt;My data has routing information stored in a CSV string such as "A,B,E,F,G" for every order. I would like to create a table of distinct routes (easy enough with load distinct) and then break down the route steps and number them based on order. There is also the possibility a step will be repeated such as "A,B,A,A,G".&lt;/P&gt;&lt;P&gt;I tried this:&lt;/P&gt;&lt;P&gt;LOAD DISTINCT&lt;/P&gt;&lt;P&gt;Route,&lt;/P&gt;&lt;P&gt;Subfield(Route,',') as RouteStep&lt;/P&gt;&lt;P&gt;RESIDENT MyData;&lt;/P&gt;&lt;P&gt;Due to distinct it only loads each type of routing once, regardless of how many times it occurs in the route. I also don't know how to add the step number. For example, if the route is "A,B,D,G,X" then the record with that route and "X" as the route step should have a StepNumber of 5.&lt;/P&gt;&lt;P&gt;Any help is appreciated. I'm sure this is not difficult but 20 minutes of googling did not yield a usable result for me.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Jun 2021 12:33:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Load-distinct-routes-and-then-route-steps-using-subfield/m-p/1817321#M66934</guid>
      <dc:creator>SDT</dc:creator>
      <dc:date>2021-06-23T12:33:32Z</dc:date>
    </item>
    <item>
      <title>Re: Load distinct routes and then route steps using subfield</title>
      <link>https://community.qlik.com/t5/App-Development/Load-distinct-routes-and-then-route-steps-using-subfield/m-p/1817325#M66935</link>
      <description>&lt;P&gt;May be do it in two steps?&lt;/P&gt;&lt;P&gt;Step 1:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;tmp:
LOAD DISTINCT
Route
RESIDENT MyData;&lt;/LI-CODE&gt;&lt;P&gt;Step 2:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Final:
LOAD Route,
     Subfield(Route,',') as RouteStep
Resident tmp;&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 23 Jun 2021 12:40:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Load-distinct-routes-and-then-route-steps-using-subfield/m-p/1817325#M66935</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2021-06-23T12:40:31Z</dc:date>
    </item>
    <item>
      <title>Re: Load distinct routes and then route steps using subfield</title>
      <link>https://community.qlik.com/t5/App-Development/Load-distinct-routes-and-then-route-steps-using-subfield/m-p/1817331#M66936</link>
      <description>&lt;P&gt;Thank you Sunny.&lt;/P&gt;&lt;P&gt;I think that would work (could it be accomplished with a previous load also?). I would still need to add something to indicate the RouteStep position in the routing though.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Jun 2021 12:45:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Load-distinct-routes-and-then-route-steps-using-subfield/m-p/1817331#M66936</guid>
      <dc:creator>SDT</dc:creator>
      <dc:date>2021-06-23T12:45:15Z</dc:date>
    </item>
    <item>
      <title>Re: Load distinct routes and then route steps using subfield</title>
      <link>https://community.qlik.com/t5/App-Development/Load-distinct-routes-and-then-route-steps-using-subfield/m-p/1817337#M66939</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Table:
LOAD * INLINE [
    Route
    "A,B,E,F,G"
    "A,B,A,A,G"
    "A,B,E,F,G"
];

Final:
LOAD DISTINCT *,
	 If(Route = Previous(Route), RangeSum(Peek('RowNo'), 1), 1) as RowNo;
LOAD Route,
	 Subfield(Route,',') as RouteStep
RESIDENT Table;

DROP Table Table;&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 23 Jun 2021 12:52:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Load-distinct-routes-and-then-route-steps-using-subfield/m-p/1817337#M66939</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2021-06-23T12:52:31Z</dc:date>
    </item>
    <item>
      <title>Re: Load distinct routes and then route steps using subfield</title>
      <link>https://community.qlik.com/t5/App-Development/Load-distinct-routes-and-then-route-steps-using-subfield/m-p/1817397#M66950</link>
      <description>&lt;P&gt;Still not giving the intended result and I think it has to do with not getting distinct order routes loaded. The maximum number of steps in any of the routes is 9 and I have RouteStepNum values up to 36.&lt;/P&gt;&lt;P&gt;[OrderRouteBreakdown]:&lt;BR /&gt;LOAD DISTINCT&lt;BR /&gt;OrderRoute,&lt;BR /&gt;OrderRouteStep,&lt;BR /&gt;IF(OrderRoute=Previous(OrderRoute), Rangesum(Peek('OrderRouteStepNum'), 1), 1) as OrderRouteStepNum;&lt;BR /&gt;LOAD&lt;BR /&gt;OrderRoute,&lt;BR /&gt;TRIM(Subfield(OrderRoute,',')) as OrderRouteStep&lt;BR /&gt;RESIDENT [OrderDueDates];&lt;/P&gt;</description>
      <pubDate>Wed, 23 Jun 2021 14:20:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Load-distinct-routes-and-then-route-steps-using-subfield/m-p/1817397#M66950</guid>
      <dc:creator>SDT</dc:creator>
      <dc:date>2021-06-23T14:20:13Z</dc:date>
    </item>
    <item>
      <title>Re: Load distinct routes and then route steps using subfield</title>
      <link>https://community.qlik.com/t5/App-Development/Load-distinct-routes-and-then-route-steps-using-subfield/m-p/1817409#M66954</link>
      <description>&lt;P&gt;Fixed it. I think the Rangesum was the problem. I also split it into two and it is working now. THANK YOU!&lt;/P&gt;&lt;P&gt;[RouteTemp]:&lt;BR /&gt;LOAD DISTINCT&lt;BR /&gt;OrderRoute&lt;BR /&gt;RESIDENT OrderDueDates;&lt;/P&gt;&lt;P&gt;[OrderRouteBreakdown]:&lt;BR /&gt;LOAD&lt;BR /&gt;OrderRoute,&lt;BR /&gt;Subfield(OrderRoute,',') as OrderRouteStep,&lt;BR /&gt;IF(OrderRoute=Previous(OrderRoute), Peek('OrderRouteStepNum')+1, 1) as OrderRouteStepNum&lt;BR /&gt;RESIDENT [RouteTemp];&lt;/P&gt;&lt;P&gt;DROP TABLE RouteTemp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Jun 2021 14:47:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Load-distinct-routes-and-then-route-steps-using-subfield/m-p/1817409#M66954</guid>
      <dc:creator>SDT</dc:creator>
      <dc:date>2021-06-23T14:47:41Z</dc:date>
    </item>
    <item>
      <title>Re: Load distinct routes and then route steps using subfield</title>
      <link>https://community.qlik.com/t5/App-Development/Load-distinct-routes-and-then-route-steps-using-subfield/m-p/1817431#M66960</link>
      <description>&lt;P&gt;Not quite right. But this is:&lt;/P&gt;&lt;P&gt;[OrderRoutes]:&lt;BR /&gt;LOAD DISTINCT&lt;BR /&gt;OrderRoute,&lt;BR /&gt;SUBstringcount(OrderRoute,'PS')&amp;amp;'PS '&amp;amp;SUBStringCount(OrderRoute,'TC')&amp;amp;'TC ' as RouteCoatings,&lt;BR /&gt;substringcount(OrderRoute,',')+1 as OrderRouteSteps&lt;BR /&gt;RESIDENT Orders;&lt;/P&gt;&lt;P&gt;[OrderRouteBreakdown]:&lt;BR /&gt;NOCONCATENATE LOAD&lt;BR /&gt;OrderRoute,&lt;BR /&gt;Subfield(OrderRoute,',') as OrderRouteStep,&lt;BR /&gt;IF(OrderRoute=Peek('OrderRoute'), Peek('OrderRouteStepNum')+1, 1) as OrderRouteStepNum&lt;BR /&gt;RESIDENT [OrderRoutes];&lt;/P&gt;</description>
      <pubDate>Wed, 23 Jun 2021 15:51:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Load-distinct-routes-and-then-route-steps-using-subfield/m-p/1817431#M66960</guid>
      <dc:creator>SDT</dc:creator>
      <dc:date>2021-06-23T15:51:54Z</dc:date>
    </item>
    <item>
      <title>Re: Load distinct routes and then route steps using subfield</title>
      <link>https://community.qlik.com/t5/App-Development/Load-distinct-routes-and-then-route-steps-using-subfield/m-p/1817502#M66966</link>
      <description>&lt;P&gt;the IETF ROLL working Whereas the OF dictates rules such as DODAG parent selection​,&amp;nbsp;load&amp;nbsp;&amp;nbsp;Nodes (B) and (C) do not&amp;nbsp;process&amp;nbsp;DIO messages from nodes deeper&amp;nbsp;than&amp;nbsp;The&amp;nbsp;subfields&amp;nbsp;are ordered by preference,&amp;nbsp;with&amp;nbsp;PC1 being the most preferred.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Jun 2021 05:29:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Load-distinct-routes-and-then-route-steps-using-subfield/m-p/1817502#M66966</guid>
      <dc:creator>terry_7896</dc:creator>
      <dc:date>2021-06-24T05:29:22Z</dc:date>
    </item>
  </channel>
</rss>

