<?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: LOAD statement - complex IF-construct as a variable in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/LOAD-statement-complex-IF-construct-as-a-variable/m-p/733831#M675346</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi DataNibbler,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would put this code inside a .txt file and then simply call it everytime I would like to use it by using the include function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;BR /&gt;Marius&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 23 Jul 2014 12:17:41 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-07-23T12:17:41Z</dc:date>
    <item>
      <title>LOAD statement - complex IF-construct as a variable</title>
      <link>https://community.qlik.com/t5/QlikView/LOAD-statement-complex-IF-construct-as-a-variable/m-p/733829#M675344</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in one of our primary loading apps, I have found an IF-construct (to define the working areas) that runs over eight lines ... to make the whole thing more resource-friendly and, more important, to avoid the risk of introducing slight differences when using the same code in another place, I want to try to create a variable for this expression and store it in a qvs file.&lt;/P&gt;&lt;P&gt;So I tried as I normally do like&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt; LET e_formula = ' ... '; &amp;lt;&amp;lt;&lt;/P&gt;&lt;P&gt;&amp;lt;=&amp;gt; That, however, did not work in this case. The formula of course contains a lot of blanks, so I tried enclosing the whole thing in square brackets like&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt; LET e_formula = '[ ... ]'; &amp;lt;&amp;lt;&lt;/P&gt;&lt;P&gt;&amp;lt;=&amp;gt; but that didn't work, either. Moreover, there are a lot of text_strings which are enclosed in upper_quotes and it contains a lot of Wildmatch() functions with *.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone give me a hint how I could get this to work?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DataNibbler&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jul 2014 12:07:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/LOAD-statement-complex-IF-construct-as-a-variable/m-p/733829#M675344</guid>
      <dc:creator>datanibbler</dc:creator>
      <dc:date>2014-07-23T12:07:31Z</dc:date>
    </item>
    <item>
      <title>Re: LOAD statement - complex IF-construct as a variable</title>
      <link>https://community.qlik.com/t5/QlikView/LOAD-statement-complex-IF-construct-as-a-variable/m-p/733830#M675345</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try using trim() function of qlikview&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Trim(Field) &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;In order to remove&amp;nbsp; spaces&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jul 2014 12:09:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/LOAD-statement-complex-IF-construct-as-a-variable/m-p/733830#M675345</guid>
      <dc:creator>sujeetsingh</dc:creator>
      <dc:date>2014-07-23T12:09:47Z</dc:date>
    </item>
    <item>
      <title>Re: LOAD statement - complex IF-construct as a variable</title>
      <link>https://community.qlik.com/t5/QlikView/LOAD-statement-complex-IF-construct-as-a-variable/m-p/733831#M675346</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi DataNibbler,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would put this code inside a .txt file and then simply call it everytime I would like to use it by using the include function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;BR /&gt;Marius&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jul 2014 12:17:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/LOAD-statement-complex-IF-construct-as-a-variable/m-p/733831#M675346</guid>
      <dc:creator />
      <dc:date>2014-07-23T12:17:41Z</dc:date>
    </item>
    <item>
      <title>Re: LOAD statement - complex IF-construct as a variable</title>
      <link>https://community.qlik.com/t5/QlikView/LOAD-statement-complex-IF-construct-as-a-variable/m-p/733832#M675347</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Marius,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;that's exactly what I want to do. Is there a way to do this other than to put it into a variable?&lt;/P&gt;&lt;P&gt;I have not been able to do that so far.&lt;/P&gt;&lt;P&gt;Also, I would like to simplify the formula a bit, that would be more resource-friendly and&amp;nbsp; maybe then it would be easier to put it in a variable, too.&lt;/P&gt;&lt;P&gt;Right now, as I said, it is an If-construct running over like eight lines, with WildMatch() functions - so I think I could not use PICK(WILDMATCH()) instead - there are several possible texts to match in every line which correspond to one area.&lt;/P&gt;&lt;P&gt;I will post the code here. Maybe someone has an idea?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;if(WildMatch(PACK_DELIVERY_BIN,'*KT*','TIMEKT','AT*','WERTE RSML','XGTKT'),'KT',&lt;/P&gt;&lt;P&gt; if(WildMatch(PACK_DELIVERY_BIN,'56GTBO','56GTSI','56GFG','56GTGW'),'56',&lt;/P&gt;&lt;P&gt;&amp;nbsp; if(WildMatch(PACK_DELIVERY_BIN,'*BT*','BTZW*','GT','GT1*','GT2','GT3','GT6','GT7','GTL*','GTR*','*FAST','*SLOW','GT ESD','GTXL','GT AIR'),'GT',&lt;/P&gt;&lt;P&gt; if(WildMatch(PACK_DELIVERY_BIN,'LV*','GLL*'),'LV',&lt;/P&gt;&lt;P&gt;&amp;nbsp; if(WildMatch(PACK_DELIVERY_BIN,'GTH*','*GEFAH*','GELENKW','WERTEXGT'),'GTH',&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; if(WildMatch(PACK_DELIVERY_BIN,'56GETR*','R3GETR*','GETRIEBE*','56LV','R3L*'),'GETRIEBE',&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(WildMatch(PACK_DELIVERY_BIN,'GTB','EVGTB'),'GTB',&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(WildMatch(PACK_DELIVERY_BIN,'GTBO'),'GTBO',&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(WildMatch(PACK_DELIVERY_BIN,'GTXL*'),'GTXL',&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(WildMatch(PACK_DELIVERY_BIN,'GTSW'),'GTSW',&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Sonstige')))))))))) as Packplatz,&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jul 2014 12:26:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/LOAD-statement-complex-IF-construct-as-a-variable/m-p/733832#M675347</guid>
      <dc:creator>datanibbler</dc:creator>
      <dc:date>2014-07-23T12:26:53Z</dc:date>
    </item>
    <item>
      <title>Re: LOAD statement - complex IF-construct as a variable</title>
      <link>https://community.qlik.com/t5/QlikView/LOAD-statement-complex-IF-construct-as-a-variable/m-p/733833#M675348</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How does the data look for &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;PACK_DELIVERY_BIN&lt;/SPAN&gt;? Do you only have a certain set of them or are there millions of different variations.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If only a hand full then I will use a mapping table instead.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And this script must take some time to run with all those wildmatches?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;BR /&gt;Marius&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jul 2014 12:30:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/LOAD-statement-complex-IF-construct-as-a-variable/m-p/733833#M675348</guid>
      <dc:creator />
      <dc:date>2014-07-23T12:30:50Z</dc:date>
    </item>
    <item>
      <title>Re: LOAD statement - complex IF-construct as a variable</title>
      <link>https://community.qlik.com/t5/QlikView/LOAD-statement-complex-IF-construct-as-a-variable/m-p/733834#M675349</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Marius,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;honestly I don't know how many variations of the text in &amp;gt;PACK_DELIVERY_BIN&amp;lt; there might be that point to one and the same area - I am not alltoo familiar with the database where this comes from.&lt;/P&gt;&lt;P&gt;I will ask my colleague. If there are no more than 10 or so, then of course it would be possible to make this into a mapping table. The problem is, there is no proper documentation of our database available, so there is always a bit of guesswork involved ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DataNibbler&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jul 2014 12:42:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/LOAD-statement-complex-IF-construct-as-a-variable/m-p/733834#M675349</guid>
      <dc:creator>datanibbler</dc:creator>
      <dc:date>2014-07-23T12:42:05Z</dc:date>
    </item>
    <item>
      <title>Re: LOAD statement - complex IF-construct as a variable</title>
      <link>https://community.qlik.com/t5/QlikView/LOAD-statement-complex-IF-construct-as-a-variable/m-p/733835#M675350</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sure thing. You can put that load script into a .txt file in the meantime and simply call it using the following in the mean time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;$(Include=abc.txt);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;BR /&gt;Marius&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jul 2014 12:48:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/LOAD-statement-complex-IF-construct-as-a-variable/m-p/733835#M675350</guid>
      <dc:creator />
      <dc:date>2014-07-23T12:48:46Z</dc:date>
    </item>
    <item>
      <title>Re: LOAD statement - complex IF-construct as a variable</title>
      <link>https://community.qlik.com/t5/QlikView/LOAD-statement-complex-IF-construct-as-a-variable/m-p/733836#M675351</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Markus,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;well, unfortunately that is not the only field I need to load from that particular database_table, so it's not that easy. I'll have to try to join that field to the table - that way I could do as you suggest.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jul 2014 13:14:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/LOAD-statement-complex-IF-construct-as-a-variable/m-p/733836#M675351</guid>
      <dc:creator>datanibbler</dc:creator>
      <dc:date>2014-07-23T13:14:49Z</dc:date>
    </item>
  </channel>
</rss>

