<?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 Combining if condition and set a variable inside load table statement in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Combining-if-condition-and-set-a-variable-inside-load-table/m-p/1832003#M68631</link>
    <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I try to set a variable with a if condition when a field value (measure) is 1.&lt;/P&gt;&lt;P&gt;table:&lt;/P&gt;&lt;P&gt;Load&amp;nbsp;&lt;/P&gt;&lt;P&gt;FieldA,&lt;/P&gt;&lt;P&gt;FieldB,&lt;/P&gt;&lt;P&gt;measure&lt;/P&gt;&lt;P&gt;FROM...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;FieldA, Field B, measure&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Porsche, Cayenne, null&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;VW, Golf, 1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Jeep, Renegade, null&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if measure is 1, I would like to set a variable with value from Field B, so in my example I would like to set vVariable to Golf but I dont know how to set a variable inside the load statement combined with a if statement.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help is appreciated, thanks a lot!&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>Sun, 29 Aug 2021 13:48:52 GMT</pubDate>
    <dc:creator>chriys1337</dc:creator>
    <dc:date>2021-08-29T13:48:52Z</dc:date>
    <item>
      <title>Combining if condition and set a variable inside load table statement</title>
      <link>https://community.qlik.com/t5/App-Development/Combining-if-condition-and-set-a-variable-inside-load-table/m-p/1832003#M68631</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I try to set a variable with a if condition when a field value (measure) is 1.&lt;/P&gt;&lt;P&gt;table:&lt;/P&gt;&lt;P&gt;Load&amp;nbsp;&lt;/P&gt;&lt;P&gt;FieldA,&lt;/P&gt;&lt;P&gt;FieldB,&lt;/P&gt;&lt;P&gt;measure&lt;/P&gt;&lt;P&gt;FROM...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;FieldA, Field B, measure&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Porsche, Cayenne, null&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;VW, Golf, 1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Jeep, Renegade, null&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if measure is 1, I would like to set a variable with value from Field B, so in my example I would like to set vVariable to Golf but I dont know how to set a variable inside the load statement combined with a if statement.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help is appreciated, thanks a lot!&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>Sun, 29 Aug 2021 13:48:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Combining-if-condition-and-set-a-variable-inside-load-table/m-p/1832003#M68631</guid>
      <dc:creator>chriys1337</dc:creator>
      <dc:date>2021-08-29T13:48:52Z</dc:date>
    </item>
    <item>
      <title>Re: Combining if condition and set a variable inside load table statement</title>
      <link>https://community.qlik.com/t5/App-Development/Combining-if-condition-and-set-a-variable-inside-load-table/m-p/1832004#M68632</link>
      <description>&lt;P&gt;I don't think you can do that directly from a load statement. You could loop through the values, but that's only feasible if the number of rows is on the small side. If you elaborate on what exactly you're trying to achieve, perhaps there's a workaround to be suggested.&lt;/P&gt;</description>
      <pubDate>Sun, 29 Aug 2021 15:59:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Combining-if-condition-and-set-a-variable-inside-load-table/m-p/1832004#M68632</guid>
      <dc:creator>Or</dc:creator>
      <dc:date>2021-08-29T15:59:54Z</dc:date>
    </item>
    <item>
      <title>Re: Combining if condition and set a variable inside load table statement</title>
      <link>https://community.qlik.com/t5/App-Development/Combining-if-condition-and-set-a-variable-inside-load-table/m-p/1832005#M68633</link>
      <description>&lt;P&gt;Try something like this,&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;tab1:
LOAD * INLINE [
FieldA, Field B, measure
Porsche, Cayenne, null
VW, Golf, 1
Jeep, Renegade, null
];

FieldB1:
NoConcatenate
LOAD DISTINCT [Field B] As Var
Resident tab1
Where measure=1
;

LET vVariable=Peek('Var',0,'FieldB1');

Trace vVariable=$(vVariable);

Drop Table FieldB1;&lt;/LI-CODE&gt;</description>
      <pubDate>Sun, 29 Aug 2021 16:07:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Combining-if-condition-and-set-a-variable-inside-load-table/m-p/1832005#M68633</guid>
      <dc:creator>Saravanan_Desingh</dc:creator>
      <dc:date>2021-08-29T16:07:09Z</dc:date>
    </item>
    <item>
      <title>Re: Combining if condition and set a variable inside load table statement</title>
      <link>https://community.qlik.com/t5/App-Development/Combining-if-condition-and-set-a-variable-inside-load-table/m-p/1832006#M68634</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/18558"&gt;@chriys1337&lt;/a&gt;&amp;nbsp; what if you have more than one value for measure=1?&lt;/P&gt;</description>
      <pubDate>Sun, 29 Aug 2021 16:27:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Combining-if-condition-and-set-a-variable-inside-load-table/m-p/1832006#M68634</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2021-08-29T16:27:08Z</dc:date>
    </item>
  </channel>
</rss>

