<?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: ODAG - how to make bindings optional in Qlik Automate</title>
    <link>https://community.qlik.com/t5/Qlik-Automate/ODAG-how-to-make-bindings-optional/m-p/2471292#M4352</link>
    <description>&lt;P&gt;If you don't select a branch, that part of the WHERE condition becomes COST_CENTER IN (), which isn't valid SQL. You'll need to rephrase either your variable setting or your code to handle the situation where no value is passed. &lt;/P&gt;</description>
    <pubDate>Wed, 17 Jul 2024 18:44:50 GMT</pubDate>
    <dc:creator>Or</dc:creator>
    <dc:date>2024-07-17T18:44:50Z</dc:date>
    <item>
      <title>ODAG - how to make bindings optional</title>
      <link>https://community.qlik.com/t5/Qlik-Automate/ODAG-how-to-make-bindings-optional/m-p/2471282#M4351</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;
&lt;P&gt;Does anyone by chance know how to make it so my bindings do not all have to be selected?&lt;/P&gt;
&lt;P&gt;Right now the on demand app is only generated correctly if all 3 “filters” have a selection in them.&amp;nbsp; If I only use 1 or 2 of them, it still turns green and meets the criteria but fails.&lt;/P&gt;
&lt;P&gt;So far can only get to work if all of them have something selected.&lt;/P&gt;
&lt;P&gt;Let vPostMonth = $(od_POSTING_EOM);&lt;/P&gt;
&lt;P&gt;Let vBranchName = $(od_ACCOUNT_ASSIGNED_BRANCH_COST_CENTER_NM);&lt;/P&gt;
&lt;P&gt;Let vRegion = $(od_RETAIL_REGION_CD);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have tried odo and odso&amp;nbsp; but it doesn’t like those.&amp;nbsp; Also odag didn't work for me.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="micklesj_0-1721236561056.png" style="width: 252px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/169517i510EF6A7AD34559D/image-dimensions/252x272?v=v2" width="252" height="272" role="button" title="micklesj_0-1721236561056.png" alt="micklesj_0-1721236561056.png" /&gt;&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;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="micklesj_1-1721236572338.png" style="width: 322px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/169518i7D60CD87E570C863/image-dimensions/322x107?v=v2" width="322" height="107" role="button" title="micklesj_1-1721236572338.png" alt="micklesj_1-1721236572338.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="micklesj_2-1721236593336.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/169519i6EE546BCCBF87B17/image-size/medium?v=v2&amp;amp;px=400" role="button" title="micklesj_2-1721236593336.png" alt="micklesj_2-1721236593336.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think it’s trying to put a blank in the variable and then bombs down at the bottom in the where clause.&amp;nbsp; Is there a way around that?&amp;nbsp; I would like them to be able to select as many as they want or none at all.&lt;/P&gt;
&lt;P&gt;It does work if a branch is selected.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="micklesj_3-1721236613130.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/169520i6E3F2F63820DCDAB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="micklesj_3-1721236613130.png" alt="micklesj_3-1721236613130.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jul 2024 17:21:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Automate/ODAG-how-to-make-bindings-optional/m-p/2471282#M4351</guid>
      <dc:creator>micklesj</dc:creator>
      <dc:date>2024-07-17T17:21:27Z</dc:date>
    </item>
    <item>
      <title>Re: ODAG - how to make bindings optional</title>
      <link>https://community.qlik.com/t5/Qlik-Automate/ODAG-how-to-make-bindings-optional/m-p/2471292#M4352</link>
      <description>&lt;P&gt;If you don't select a branch, that part of the WHERE condition becomes COST_CENTER IN (), which isn't valid SQL. You'll need to rephrase either your variable setting or your code to handle the situation where no value is passed. &lt;/P&gt;</description>
      <pubDate>Wed, 17 Jul 2024 18:44:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Automate/ODAG-how-to-make-bindings-optional/m-p/2471292#M4352</guid>
      <dc:creator>Or</dc:creator>
      <dc:date>2024-07-17T18:44:50Z</dc:date>
    </item>
    <item>
      <title>Re: ODAG - how to make bindings optional</title>
      <link>https://community.qlik.com/t5/Qlik-Automate/ODAG-how-to-make-bindings-optional/m-p/2471448#M4355</link>
      <description>&lt;P&gt;thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2024 10:06:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Automate/ODAG-how-to-make-bindings-optional/m-p/2471448#M4355</guid>
      <dc:creator>micklesj</dc:creator>
      <dc:date>2024-07-18T10:06:05Z</dc:date>
    </item>
    <item>
      <title>Re: ODAG - how to make bindings optional</title>
      <link>https://community.qlik.com/t5/Qlik-Automate/ODAG-how-to-make-bindings-optional/m-p/2472447#M4379</link>
      <description>&lt;P&gt;Ok yes, that was helpful thank you!&amp;nbsp; This is what we had to do to make this work:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(and you have to do it for every single binding)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let vRegion = $(od_RETAIL_REGION_CD);&lt;/P&gt;
&lt;P&gt;[Temp_RETAIL_REGION_CD]:&lt;BR /&gt;SQL SELECT ''''||LISTAGG(DISTINCT RETAIL_REGION_CD, ''',''')||'''' as REGIONS&lt;BR /&gt;FROM XXX.XXXX.XXXXXXXXX_VW&lt;BR /&gt;WHERE RETAIL_REGION_CD IS NOT NULL&lt;BR /&gt;;&lt;/P&gt;
&lt;P&gt;Let vRegionAll = peek('REGIONS',0,'Temp_RETAIL_REGION_CD') ;&lt;BR /&gt;Trace vRegionAll;&lt;/P&gt;
&lt;P&gt;IF ('$(vRegion)') ='' THEN;&lt;BR /&gt;let vRegionSQL = vRegionAll;&lt;BR /&gt;ELSE;&lt;BR /&gt;let vRegionSQL=vRegion; &lt;BR /&gt;END IF; &lt;BR /&gt;Drop Table Temp_RETAIL_REGION_CD;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and then later at the bottom of the main query&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Where&amp;nbsp; RETAIL_REGION_CD In ($(vRegionSQL))&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jul 2024 16:33:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Automate/ODAG-how-to-make-bindings-optional/m-p/2472447#M4379</guid>
      <dc:creator>micklesj</dc:creator>
      <dc:date>2024-07-23T16:33:21Z</dc:date>
    </item>
    <item>
      <title>Re: ODAG - how to make bindings optional</title>
      <link>https://community.qlik.com/t5/Qlik-Automate/ODAG-how-to-make-bindings-optional/m-p/2472471#M4386</link>
      <description>&lt;P&gt;That is indeed one option.&lt;/P&gt;
&lt;P&gt;You could also use something like:&lt;/P&gt;
&lt;P&gt;If Len(vRegion) &amp;gt; 0 Then&lt;/P&gt;
&lt;P&gt;Original Code Goes Here&lt;/P&gt;
&lt;P&gt;Else&lt;/P&gt;
&lt;P&gt;Same Code Goes Here But without the condition on Region&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or you could write it straight into your SQL, something like:&lt;/P&gt;
&lt;P&gt;Let vRegion = Coalesce($(od_RETAIL_REGION_CD),'ZZZZZ');&lt;/P&gt;
&lt;P&gt;Select Something From Somewhere&lt;/P&gt;
&lt;P&gt;Where (Region IN ('$(vRegion)')&amp;nbsp; OR Region = 'ZZZZZ')&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jul 2024 18:16:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Automate/ODAG-how-to-make-bindings-optional/m-p/2472471#M4386</guid>
      <dc:creator>Or</dc:creator>
      <dc:date>2024-07-23T18:16:40Z</dc:date>
    </item>
  </channel>
</rss>

