<?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: Turning one Work Task into multiple ones in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Turning-one-Work-Task-into-multiple-ones/m-p/2469085#M99524</link>
    <description>&lt;P&gt;try this,&lt;/P&gt;
&lt;P&gt;FinalTable:&lt;/P&gt;
&lt;P&gt;LOAD *,&lt;BR /&gt;If(Stage &amp;gt;= 'a' and Stage &amp;lt;= 'd', 'Task 1',&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; If(Stage = 'e', 'Task 2',&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; If(Stage &amp;gt;= 'f' and Stage &amp;lt;= 'i', 'Task 3'))) as TaskType,&lt;BR /&gt;If(Stage &amp;gt;= 'a' and Stage &amp;lt;= 'd', EndTime,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;If(Stage = 'e', StartTime,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; If(Stage &amp;gt;= 'f' and Stage &amp;lt;= 'i', StartTime))) as StartTime,&lt;BR /&gt;If(Stage &amp;gt;= 'a' and Stage &amp;lt;= 'd', StartTime,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; If(Stage = 'e', EndTime,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; If(Stage &amp;gt;= 'f' and Stage &amp;lt;= 'i', EndTime))) as EndTime;&lt;BR /&gt;LOAD *&lt;BR /&gt;FROM Table;&lt;/P&gt;
&lt;P&gt;for the scenario where not all stages were performed, you can add an additional condition to check if the EndTime is null and if so, set it to Today() &amp;amp; '17:00:00'&lt;/P&gt;
&lt;P&gt;I hope this helps.&lt;/P&gt;</description>
    <pubDate>Tue, 09 Jul 2024 09:52:52 GMT</pubDate>
    <dc:creator>Sayed_Mannan</dc:creator>
    <dc:date>2024-07-09T09:52:52Z</dc:date>
    <item>
      <title>Turning one Work Task into multiple ones</title>
      <link>https://community.qlik.com/t5/App-Development/Turning-one-Work-Task-into-multiple-ones/m-p/2468990#M99514</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First of all, no, it is not about QMC task.&lt;/P&gt;
&lt;P&gt;Please see the attached data example.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have the following requirement:&lt;/P&gt;
&lt;P&gt;My data is a table with tasks (every task has a unique ID)&lt;/P&gt;
&lt;P&gt;Every task has stages (a to i) with start timestamp and end Time stamp.&lt;/P&gt;
&lt;P&gt;I need to split each task to 3 separate tasks.&lt;/P&gt;
&lt;P&gt;the way to do that is as follows:&lt;/P&gt;
&lt;P&gt;From stage a to d - Task 1&lt;/P&gt;
&lt;P&gt;Stage e&amp;nbsp; &amp;nbsp;- Task 2&lt;/P&gt;
&lt;P&gt;From Stage f to I -Task 3&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Another table should be created with the new tasks and start timestamp and end timestamp with the following logic:&lt;/P&gt;
&lt;P&gt;The end time of stage 1 will be taken from the start time of stage 2,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The end time of stage 2 will be taken from the start time of stage 3.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But there are times when not all the stages were performed Hence won't appear in the data) and I Still have to split them. In this case, the end time of the last task would be Today () &amp;amp; '17:00:00'.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Again, I've attached an example with different scenarios.&lt;/P&gt;
&lt;P&gt;Any ideas are welcomed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&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, 09 Jul 2024 07:39:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Turning-one-Work-Task-into-multiple-ones/m-p/2468990#M99514</guid>
      <dc:creator>sogloqlik</dc:creator>
      <dc:date>2024-07-09T07:39:00Z</dc:date>
    </item>
    <item>
      <title>Re: Turning one Work Task into multiple ones</title>
      <link>https://community.qlik.com/t5/App-Development/Turning-one-Work-Task-into-multiple-ones/m-p/2469085#M99524</link>
      <description>&lt;P&gt;try this,&lt;/P&gt;
&lt;P&gt;FinalTable:&lt;/P&gt;
&lt;P&gt;LOAD *,&lt;BR /&gt;If(Stage &amp;gt;= 'a' and Stage &amp;lt;= 'd', 'Task 1',&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; If(Stage = 'e', 'Task 2',&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; If(Stage &amp;gt;= 'f' and Stage &amp;lt;= 'i', 'Task 3'))) as TaskType,&lt;BR /&gt;If(Stage &amp;gt;= 'a' and Stage &amp;lt;= 'd', EndTime,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;If(Stage = 'e', StartTime,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; If(Stage &amp;gt;= 'f' and Stage &amp;lt;= 'i', StartTime))) as StartTime,&lt;BR /&gt;If(Stage &amp;gt;= 'a' and Stage &amp;lt;= 'd', StartTime,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; If(Stage = 'e', EndTime,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; If(Stage &amp;gt;= 'f' and Stage &amp;lt;= 'i', EndTime))) as EndTime;&lt;BR /&gt;LOAD *&lt;BR /&gt;FROM Table;&lt;/P&gt;
&lt;P&gt;for the scenario where not all stages were performed, you can add an additional condition to check if the EndTime is null and if so, set it to Today() &amp;amp; '17:00:00'&lt;/P&gt;
&lt;P&gt;I hope this helps.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2024 09:52:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Turning-one-Work-Task-into-multiple-ones/m-p/2469085#M99524</guid>
      <dc:creator>Sayed_Mannan</dc:creator>
      <dc:date>2024-07-09T09:52:52Z</dc:date>
    </item>
    <item>
      <title>Re: Turning one Work Task into multiple ones</title>
      <link>https://community.qlik.com/t5/App-Development/Turning-one-Work-Task-into-multiple-ones/m-p/2469102#M99525</link>
      <description>&lt;P&gt;Thank you for your answer, I will try it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to add another complexity: in some cases, stage e would be done before stage a but will still have to be onsidered as task_2, How would you adjust the code?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2024 10:49:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Turning-one-Work-Task-into-multiple-ones/m-p/2469102#M99525</guid>
      <dc:creator>sogloqlik</dc:creator>
      <dc:date>2024-07-09T10:49:52Z</dc:date>
    </item>
    <item>
      <title>Re: Turning one Work Task into multiple ones</title>
      <link>https://community.qlik.com/t5/App-Development/Turning-one-Work-Task-into-multiple-ones/m-p/2469119#M99527</link>
      <description>&lt;P&gt;based on your new use case I'll update my script like this:&lt;/P&gt;
&lt;P&gt;FinalTable:&lt;BR /&gt;LOAD *,&lt;BR /&gt;If(Stage = 'e', 'Task 2',&lt;BR /&gt;If(Stage &amp;gt;= 'a' and Stage &amp;lt;= 'd', 'Task 1',&lt;BR /&gt;If(Stage &amp;gt;= 'f' and Stage &amp;lt;= 'i', 'Task 3'))) as TaskType,&lt;BR /&gt;If(Stage = 'e', StartTime,&lt;BR /&gt;If(Stage &amp;gt;= 'a' and Stage &amp;lt;= 'd', EndTime,&lt;BR /&gt;If(Stage &amp;gt;= 'f' and Stage &amp;lt;= 'i', StartTime))) as StartTime,&lt;BR /&gt;If(Stage = 'e', EndTime,&lt;BR /&gt;If(Stage &amp;gt;= 'a' and Stage &amp;lt;= 'd', StartTime,&lt;BR /&gt;If(Stage &amp;gt;= 'f' and Stage &amp;lt;= 'i', EndTime))) as EndTime;&lt;BR /&gt;LOAD *&lt;BR /&gt;FROM YourTable;&lt;/P&gt;
&lt;P&gt;// For the scenario where not all stages were performed&lt;BR /&gt;NoStages:&lt;BR /&gt;LOAD *,&lt;BR /&gt;If(IsNull(EndTime), Today() &amp;amp; '17:00:00', EndTime) as EndTime&lt;BR /&gt;Resident FinalTable;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2024 11:20:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Turning-one-Work-Task-into-multiple-ones/m-p/2469119#M99527</guid>
      <dc:creator>Sayed_Mannan</dc:creator>
      <dc:date>2024-07-09T11:20:21Z</dc:date>
    </item>
  </channel>
</rss>

