<?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 Dynamic If Statement in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Dynamic-If-Statement/m-p/1833360#M68797</link>
    <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="melissapluke_0-1630607328883.png" style="width: 785px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/61237i55AEAE1B68930DA8/image-dimensions/785x361?v=v2" width="785" height="361" role="button" title="melissapluke_0-1630607328883.png" alt="melissapluke_0-1630607328883.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I have a script that is creating a dynamic field name by looping. See screenshot for "original_claim$(aa)".&amp;nbsp;&lt;/P&gt;&lt;P&gt;In my sample data, I know that the loop happened 12 times, so I created the "FindingMostRecent_Step2" table by using that knowledge. Going forward, with live data, I won't know how many times something looped in a given instance. I'd like to be able to create the "Step 2" table dynamically, using variables somehow, but I can't seem to figure it out. Any ideas?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Melissa&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 02 Sep 2021 18:32:26 GMT</pubDate>
    <dc:creator>melissapluke</dc:creator>
    <dc:date>2021-09-02T18:32:26Z</dc:date>
    <item>
      <title>Dynamic If Statement</title>
      <link>https://community.qlik.com/t5/App-Development/Dynamic-If-Statement/m-p/1833360#M68797</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="melissapluke_0-1630607328883.png" style="width: 785px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/61237i55AEAE1B68930DA8/image-dimensions/785x361?v=v2" width="785" height="361" role="button" title="melissapluke_0-1630607328883.png" alt="melissapluke_0-1630607328883.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I have a script that is creating a dynamic field name by looping. See screenshot for "original_claim$(aa)".&amp;nbsp;&lt;/P&gt;&lt;P&gt;In my sample data, I know that the loop happened 12 times, so I created the "FindingMostRecent_Step2" table by using that knowledge. Going forward, with live data, I won't know how many times something looped in a given instance. I'd like to be able to create the "Step 2" table dynamically, using variables somehow, but I can't seem to figure it out. Any ideas?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Melissa&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Sep 2021 18:32:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Dynamic-If-Statement/m-p/1833360#M68797</guid>
      <dc:creator>melissapluke</dc:creator>
      <dc:date>2021-09-02T18:32:26Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic If Statement</title>
      <link>https://community.qlik.com/t5/App-Development/Dynamic-If-Statement/m-p/1833381#M68798</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/27283"&gt;@melissapluke&lt;/a&gt;&amp;nbsp; you can do this.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I replied in a post a couple days ago and I did something similar you can take a look at.&amp;nbsp; In your do loop, dynamically create a variable that contains your whole if(len ... statement.&amp;nbsp; you'll keep updating it each loop with let vFieldCondition&amp;nbsp; = $(vFieldCondition) &amp;amp; 'new logic'&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/t5/App-Development/Create-combinations-of-a-set/m-p/1832646#M68723" target="_blank" rel="noopener"&gt;https://community.qlik.com/t5/App-Development/Create-combinations-of-a-set/m-p/1832646#M68723&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I pulled out only a few lines in that post that you can focus on.&amp;nbsp; In my case i had an initial value to variable.&amp;nbsp; If you don't, or the first loop is different (because you don't want to start variable with '&amp;amp; ' &amp;amp; 'your condition', you do an if-statement based on len(&lt;SPAN&gt;$(vcombination_calc)).&amp;nbsp; In my case i was concatenating n number of fields like&amp;nbsp;//items1 &amp;amp; ',' &amp;amp; items2 &amp;amp; ',' &amp;amp; itemsN&amp;nbsp;as combination.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I didn't disect your logic, but this is doable like below.&amp;nbsp; If you have an issue getting the right result you can reply back.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;//initial syntax&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;set vcombination_calc = items1;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;//after first syntax&lt;BR /&gt;let vcombination_calc = '$(vcombination_calc)' &amp;amp; ' &amp;amp; ' &amp;amp; chr(39) &amp;amp; ',' &amp;amp; chr(39) &amp;amp; '&amp;amp; items' &amp;amp; $(i) ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;,$(vcombination_calc) as combination&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Sep 2021 19:31:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Dynamic-If-Statement/m-p/1833381#M68798</guid>
      <dc:creator>stevejoyce</dc:creator>
      <dc:date>2021-09-02T19:31:34Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic If Statement</title>
      <link>https://community.qlik.com/t5/App-Development/Dynamic-If-Statement/m-p/1833696#M68825</link>
      <description>&lt;P&gt;This works perfectly. Thank you for your help!&lt;/P&gt;</description>
      <pubDate>Fri, 03 Sep 2021 15:22:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Dynamic-If-Statement/m-p/1833696#M68825</guid>
      <dc:creator>melissapluke</dc:creator>
      <dc:date>2021-09-03T15:22:08Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic If Statement</title>
      <link>https://community.qlik.com/t5/App-Development/Dynamic-If-Statement/m-p/2032009#M85023</link>
      <description>&lt;P&gt;Hi Melissa,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you share the script and how did you solve this problem. Since i am facing similar issue&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jan 2023 09:52:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Dynamic-If-Statement/m-p/2032009#M85023</guid>
      <dc:creator>rajeshwar1</dc:creator>
      <dc:date>2023-01-31T09:52:12Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic If Statement</title>
      <link>https://community.qlik.com/t5/App-Development/Dynamic-If-Statement/m-p/2032393#M85063</link>
      <description>&lt;P&gt;Sure, here you go:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;//this is finding the claim that was before it in the series&lt;BR /&gt;set aa=2;&lt;BR /&gt;let vfinallevelifstatement1='1';&lt;BR /&gt;let voriginalclaimifstatement1='"1_Control Number"';&lt;BR /&gt;//////////////////&lt;BR /&gt;//beginning of loop&lt;BR /&gt;//////////////////&lt;BR /&gt;Do while aa&amp;lt;b;&lt;BR /&gt;left Join (FindingMostRecent_Step1)&lt;BR /&gt;Load Distinct&lt;BR /&gt;"$(aa)_Control Number" as "1_Control Number",&lt;BR /&gt;"1_Control Number" as "original_claim$(aa)",&lt;BR /&gt;$(aa) as "level$(aa)"&lt;BR /&gt;resident FindingMostRecent_Step1;&lt;BR /&gt;let vfinallevelifstatement='if(len(level$(aa))&amp;gt;0,level$(aa),'&amp;amp;'$(vfinallevelifstatement1)'&amp;amp;')';&lt;BR /&gt;let vfinallevelifstatement1='$(vfinallevelifstatement)';&lt;BR /&gt;let voriginalclaimifstatement='if(len(original_claim$(aa))&amp;gt;0,original_claim$(aa),'&amp;amp;'$(voriginalclaimifstatement1)'&amp;amp;')';&lt;BR /&gt;let voriginalclaimifstatement1='$(voriginalclaimifstatement)';&lt;BR /&gt;let aa=aa+1;&lt;BR /&gt;Loop&lt;/P&gt;
&lt;P&gt;//////////////////&lt;BR /&gt;//end of loop&lt;BR /&gt;//////////////////&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jan 2023 17:52:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Dynamic-If-Statement/m-p/2032393#M85063</guid>
      <dc:creator>melissapluke</dc:creator>
      <dc:date>2023-01-31T17:52:28Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic If Statement</title>
      <link>https://community.qlik.com/t5/App-Development/Dynamic-If-Statement/m-p/2033016#M85119</link>
      <description>&lt;P&gt;Thanks Melissa!!&lt;/P&gt;
&lt;P&gt;Could you share what's table &lt;STRONG&gt;FindingMostRecent_Step1&lt;/STRONG&gt; where left join is happening and what's Variable "&lt;STRONG&gt;b&lt;/STRONG&gt;" as i am not getting what it is&lt;/P&gt;</description>
      <pubDate>Wed, 01 Feb 2023 18:39:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Dynamic-If-Statement/m-p/2033016#M85119</guid>
      <dc:creator>rajeshwar1</dc:creator>
      <dc:date>2023-02-01T18:39:21Z</dc:date>
    </item>
  </channel>
</rss>

