<?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: Data model with multi-stage flows in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Data-model-with-multi-stage-flows/m-p/2527561#M107408</link>
    <description>&lt;P&gt;Try maybe like that:&lt;/P&gt;&lt;P&gt;// Load all entries&lt;BR /&gt;Stages:&lt;BR /&gt;LOAD&lt;BR /&gt;LotNr,&lt;BR /&gt;OrderNr AS FA_Nummer,&lt;BR /&gt;'Purchase' AS Stage,&lt;BR /&gt;0 AS EntryType&lt;BR /&gt;FROM [ExcelFile.xlsx] (ooxml, embedded labels, table is Tabelle1);&lt;/P&gt;&lt;P&gt;CONCATENATE (Stages)&lt;BR /&gt;LOAD&lt;BR /&gt;LotNr,&lt;BR /&gt;OrderNr AS FA_Nummer,&lt;BR /&gt;'Input' AS Stage,&lt;BR /&gt;5 AS EntryType&lt;BR /&gt;RESIDENT StagesRaw;&lt;/P&gt;&lt;P&gt;CONCATENATE (Stages)&lt;BR /&gt;LOAD&lt;BR /&gt;LotNr,&lt;BR /&gt;OrderNr AS FA_Nummer,&lt;BR /&gt;'Output' AS Stage,&lt;BR /&gt;6 AS EntryType&lt;BR /&gt;RESIDENT StagesRaw;&lt;/P&gt;&lt;P&gt;CONCATENATE (Stages)&lt;BR /&gt;LOAD&lt;BR /&gt;LotNr,&lt;BR /&gt;OrderNr AS FA_Nummer,&lt;BR /&gt;'Sale' AS Stage,&lt;BR /&gt;1 AS EntryType&lt;BR /&gt;RESIDENT StagesRaw;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;///////////////////////////&lt;/P&gt;&lt;P&gt;LET vMaxIterations = 10;&lt;/P&gt;&lt;P&gt;FOR i = 1 TO $(vMaxIterations)&lt;/P&gt;&lt;P&gt;ChainStep:&lt;BR /&gt;LEFT JOIN (Stages)&lt;BR /&gt;LOAD&lt;BR /&gt;Output.LotNr AS FromLot,&lt;BR /&gt;Output.FA_Nummer AS FA_Link,&lt;BR /&gt;Input.LotNr AS ToLot,&lt;BR /&gt;Input.FA_Nummer AS FA_Nummer&lt;BR /&gt;RESIDENT Stages AS Output&lt;BR /&gt;JOIN&lt;BR /&gt;RESIDENT Stages AS Input&lt;BR /&gt;WHERE Output.EntryType = 6 AND Input.EntryType = 5&lt;BR /&gt;AND Output.FA_Nummer = Input.FA_Nummer;&lt;/P&gt;&lt;P&gt;&amp;nbsp;CONCATENATE(ChainProgress)&lt;BR /&gt;LOAD * RESIDENT ChainStep;&lt;/P&gt;&lt;P&gt;DROP TABLE ChainStep;&lt;/P&gt;&lt;P&gt;NEXT i;&lt;/P&gt;</description>
    <pubDate>Mon, 18 Aug 2025 10:41:08 GMT</pubDate>
    <dc:creator>robert_mika</dc:creator>
    <dc:date>2025-08-18T10:41:08Z</dc:date>
    <item>
      <title>Data model with multi-stage flows</title>
      <link>https://community.qlik.com/t5/App-Development/Data-model-with-multi-stage-flows/m-p/2527539#M107407</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;I’m currently building a data model in Qlik Sense and would appreciate some guidance. I tried for hours but I can't find any solution. I think the best way would be a loop but I can't get the code right.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;The structure looks like this:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Purchases&lt;/STRONG&gt; (EntryType = 0) are always the &lt;STRONG&gt;starting point&lt;/STRONG&gt;.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Sales&lt;/STRONG&gt; (EntryType = 1) are always the &lt;STRONG&gt;end point&lt;/STRONG&gt;.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;In between, there can be any number of stages consisting of &lt;STRONG&gt;Input&amp;nbsp;&lt;/STRONG&gt;(EntryType = 5) and &lt;STRONG&gt;Output&lt;/STRONG&gt; (EntryType = 6).&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Links between stages are based on LotNo and FA_Nummer.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;One FA_Nummer can relate to multiple LotNo.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Sales always represent the termination of the chain.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;There is no explicit field that directly connects a Production Reporting entry to the following Consumption entry.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;I’d like to create a data model that allows me to trace a flow starting from Purchases, through any number of intermediate Consumption/Production steps, until the final Sale.&lt;/P&gt;&lt;P&gt;Because there’s no explicit link between a Production Reporting record and the subsequent Consumption record, I’m unsure how to correctly model these intermediate stages so the full chain can be followed.&lt;/P&gt;&lt;P&gt;Unfortunately there's no BOM in the source that I could refer to.&lt;/P&gt;&lt;P&gt;I attached an xlsx to outline how the data is connected.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Has anyone faced a similar scenario, or do you have recommendations for how to structure this in Qlik Sense?&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Mon, 18 Aug 2025 06:20:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Data-model-with-multi-stage-flows/m-p/2527539#M107407</guid>
      <dc:creator>andreas-ar</dc:creator>
      <dc:date>2025-08-18T06:20:50Z</dc:date>
    </item>
    <item>
      <title>Re: Data model with multi-stage flows</title>
      <link>https://community.qlik.com/t5/App-Development/Data-model-with-multi-stage-flows/m-p/2527561#M107408</link>
      <description>&lt;P&gt;Try maybe like that:&lt;/P&gt;&lt;P&gt;// Load all entries&lt;BR /&gt;Stages:&lt;BR /&gt;LOAD&lt;BR /&gt;LotNr,&lt;BR /&gt;OrderNr AS FA_Nummer,&lt;BR /&gt;'Purchase' AS Stage,&lt;BR /&gt;0 AS EntryType&lt;BR /&gt;FROM [ExcelFile.xlsx] (ooxml, embedded labels, table is Tabelle1);&lt;/P&gt;&lt;P&gt;CONCATENATE (Stages)&lt;BR /&gt;LOAD&lt;BR /&gt;LotNr,&lt;BR /&gt;OrderNr AS FA_Nummer,&lt;BR /&gt;'Input' AS Stage,&lt;BR /&gt;5 AS EntryType&lt;BR /&gt;RESIDENT StagesRaw;&lt;/P&gt;&lt;P&gt;CONCATENATE (Stages)&lt;BR /&gt;LOAD&lt;BR /&gt;LotNr,&lt;BR /&gt;OrderNr AS FA_Nummer,&lt;BR /&gt;'Output' AS Stage,&lt;BR /&gt;6 AS EntryType&lt;BR /&gt;RESIDENT StagesRaw;&lt;/P&gt;&lt;P&gt;CONCATENATE (Stages)&lt;BR /&gt;LOAD&lt;BR /&gt;LotNr,&lt;BR /&gt;OrderNr AS FA_Nummer,&lt;BR /&gt;'Sale' AS Stage,&lt;BR /&gt;1 AS EntryType&lt;BR /&gt;RESIDENT StagesRaw;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;///////////////////////////&lt;/P&gt;&lt;P&gt;LET vMaxIterations = 10;&lt;/P&gt;&lt;P&gt;FOR i = 1 TO $(vMaxIterations)&lt;/P&gt;&lt;P&gt;ChainStep:&lt;BR /&gt;LEFT JOIN (Stages)&lt;BR /&gt;LOAD&lt;BR /&gt;Output.LotNr AS FromLot,&lt;BR /&gt;Output.FA_Nummer AS FA_Link,&lt;BR /&gt;Input.LotNr AS ToLot,&lt;BR /&gt;Input.FA_Nummer AS FA_Nummer&lt;BR /&gt;RESIDENT Stages AS Output&lt;BR /&gt;JOIN&lt;BR /&gt;RESIDENT Stages AS Input&lt;BR /&gt;WHERE Output.EntryType = 6 AND Input.EntryType = 5&lt;BR /&gt;AND Output.FA_Nummer = Input.FA_Nummer;&lt;/P&gt;&lt;P&gt;&amp;nbsp;CONCATENATE(ChainProgress)&lt;BR /&gt;LOAD * RESIDENT ChainStep;&lt;/P&gt;&lt;P&gt;DROP TABLE ChainStep;&lt;/P&gt;&lt;P&gt;NEXT i;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Aug 2025 10:41:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Data-model-with-multi-stage-flows/m-p/2527561#M107408</guid>
      <dc:creator>robert_mika</dc:creator>
      <dc:date>2025-08-18T10:41:08Z</dc:date>
    </item>
  </channel>
</rss>

