<?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: Conditional Load in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Conditional-Load/m-p/765867#M272163</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How about:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;MapCustPropCity:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;MAPPING LOAD idcustomer &amp;amp; '|' &amp;amp; idcustomerprop, idcity;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;SQL SELECT * FROM CUSTOMER_PROP;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;MapCustCity:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;MAPPING LOAD idcustomer, idcity;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;SQL SELECT * FROM CUSTOMER;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;LOAD idorder, idcustomer, idcustomerprop, qtyorder,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (IsNull(idcustomerprop), applymap('MapCustCity', idcustomer),&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; applymap('MapCustPropCity', idcustomer &amp;amp; '|' &amp;amp; idcustomerprop)) AS idcity;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;SELECT * FROM ORDER;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Adjust the different SQL statements so that they fit your situation.&lt;/P&gt;&lt;P&gt;You can also accomplish the same with a few LEFT JOINS and a RESIDENT LOAD, but I think the Mapping Table-approach is faster.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 10 Jan 2015 00:04:57 GMT</pubDate>
    <dc:creator>Peter_Cammaert</dc:creator>
    <dc:date>2015-01-10T00:04:57Z</dc:date>
    <item>
      <title>Conditional Load</title>
      <link>https://community.qlik.com/t5/QlikView/Conditional-Load/m-p/765866#M272162</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How to load data based on other table field value?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have this tables load with sql select.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tab CITY:&lt;/P&gt;&lt;P&gt;idcity,&lt;/P&gt;&lt;P&gt;namecity;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tab ORDER;&lt;/P&gt;&lt;P&gt;idorder,&lt;/P&gt;&lt;P&gt;idcustomer,&lt;/P&gt;&lt;P&gt;idcustomerprop,&lt;BR /&gt;qtyorder;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;tab CUSTOMER:&lt;/P&gt;&lt;P&gt;idcustomer,&lt;/P&gt;&lt;P&gt;idcity;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tab CUSTOMER_PROP:&lt;BR /&gt;idcustomerprop,&lt;/P&gt;&lt;P&gt;idcustomer,&lt;/P&gt;&lt;P&gt;idcity&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the condition I need on load:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF ORDER.idcustomerprop is null THEN CUSTOMER.idcity = CUSTOMER_PROP.idcity else CUSTOMER.idcity = CUSTOMER.idcity&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Each CUSTOMER, have one MAIN CITY and might have others PROPRIETIES, with different CITY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On table ORDER, if the field idcustomerprop have any value, this means that the ORDER is related to the&amp;nbsp; CUSTOMER_PROP city, and if the same field is NULL then, the ORDER is related to the main CUSTOMER city.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When doing this on a SQL QUERY, I use case when, but I don't know how to solve this on load script...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry if I couldn't explain better.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Jan 2015 22:34:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Conditional-Load/m-p/765866#M272162</guid>
      <dc:creator>hvfalcao</dc:creator>
      <dc:date>2015-01-09T22:34:50Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Load</title>
      <link>https://community.qlik.com/t5/QlikView/Conditional-Load/m-p/765867#M272163</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How about:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;MapCustPropCity:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;MAPPING LOAD idcustomer &amp;amp; '|' &amp;amp; idcustomerprop, idcity;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;SQL SELECT * FROM CUSTOMER_PROP;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;MapCustCity:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;MAPPING LOAD idcustomer, idcity;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;SQL SELECT * FROM CUSTOMER;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;LOAD idorder, idcustomer, idcustomerprop, qtyorder,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (IsNull(idcustomerprop), applymap('MapCustCity', idcustomer),&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; applymap('MapCustPropCity', idcustomer &amp;amp; '|' &amp;amp; idcustomerprop)) AS idcity;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;SELECT * FROM ORDER;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Adjust the different SQL statements so that they fit your situation.&lt;/P&gt;&lt;P&gt;You can also accomplish the same with a few LEFT JOINS and a RESIDENT LOAD, but I think the Mapping Table-approach is faster.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 10 Jan 2015 00:04:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Conditional-Load/m-p/765867#M272163</guid>
      <dc:creator>Peter_Cammaert</dc:creator>
      <dc:date>2015-01-10T00:04:57Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Load</title>
      <link>https://community.qlik.com/t5/QlikView/Conditional-Load/m-p/765868#M272164</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Peter,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just perfect... Thank you very much!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Henrique&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 10 Jan 2015 13:15:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Conditional-Load/m-p/765868#M272164</guid>
      <dc:creator>hvfalcao</dc:creator>
      <dc:date>2015-01-10T13:15:47Z</dc:date>
    </item>
  </channel>
</rss>

