<?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: Table join with nested if statement in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Table-join-with-nested-if-statement/m-p/656886#M674452</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Ruud&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you provide sample qvw file?&lt;/P&gt;&lt;P&gt;It would be easier to help you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Andrei&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 25 Jul 2014 19:05:20 GMT</pubDate>
    <dc:creator>crusader_</dc:creator>
    <dc:date>2014-07-25T19:05:20Z</dc:date>
    <item>
      <title>Table join with nested if statement</title>
      <link>https://community.qlik.com/t5/QlikView/Table-join-with-nested-if-statement/m-p/656885#M674451</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I keep getting the syntax error: ')' expected for the following code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load VHE_ID,&lt;/P&gt;&lt;P&gt;VHE_EPA&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;[Vastgoed kenmerk.xlsx]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;left join&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load Distinct VHE_ID, //optioneel Distinct weghalen aangezien VHE_ID vaker voorkomt bij HP_MAXHUUR&lt;/P&gt;&lt;P&gt;HP_MAXHUUR&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;[Huurprijzen.xlsx]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;StreefhuurPerEpa:&lt;/P&gt;&lt;P&gt;Load*,&lt;/P&gt;&lt;P&gt;&amp;nbsp; if(VHE_EPA='A', (HP_MAXHUUR*$(NormEPA-A)),&lt;/P&gt;&lt;P&gt;&amp;nbsp; if(VHE_EPA='B', (HP_MAXHUUR*$(NormEPA-B)),&lt;/P&gt;&lt;P&gt;&amp;nbsp; if(VHE_EPA='C', (HP_MAXHUUR*$(NormEPA-C)),&lt;/P&gt;&lt;P&gt;&amp;nbsp; if(VHE_EPA='D', (HP_MAXHUUR*$(NormEPA-D)),&lt;/P&gt;&lt;P&gt;&amp;nbsp; if(VHE_EPA='E', (HP_MAXHUUR*$(NormEPA-E)),&lt;/P&gt;&lt;P&gt;&amp;nbsp; if(VHE_EPA='F', (HP_MAXHUUR*$(NormEPA-F)),&lt;/P&gt;&lt;P&gt;&amp;nbsp; if(VHE_EPA='G', (HP_MAXHUUR*$(NormEPA-G)), (HP_MAXHUUR*$(Streefnorm_overige))&lt;/P&gt;&lt;P&gt;&amp;nbsp; )))))))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The idea is that a percentage is calculated (NormEPA- has a value between 0-1) of HP_MAXHUUR based on the value of VHE_EPA. So if VHE has EPA A, H_MAXHUUR is multiplied by the corresponding percentage NormEPA-A.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried to this if statement in a graph but it didn't work, so I decided to calculate it as a field in the loading script because this would also improve the app UI performance wise.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The reason I use a left join is because EPA is in a differenct excel file than HP_MAXHUUR.&lt;/P&gt;&lt;P&gt;Also noteworthy is that HP_MAXHUUR isn't distinct, meaning that VHE_ID and HP_MAXHUUR have three values in the excel file.&lt;/P&gt;&lt;P&gt;for example:&lt;/P&gt;&lt;P&gt;Year&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; VHE_ID&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; HP_MAXHUUR&lt;BR /&gt;2012&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0001&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 869&lt;/P&gt;&lt;P&gt;2013&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0001&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 896&lt;/P&gt;&lt;P&gt;2014&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0001&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 865&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The table of EPA is:&lt;/P&gt;&lt;P&gt;VHE_ID&amp;nbsp;&amp;nbsp; VHE_EPA&lt;/P&gt;&lt;P&gt;0001&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; A&lt;/P&gt;&lt;P&gt;0002&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; D&lt;/P&gt;&lt;P&gt;etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AS [StreefhuurPerEPA]&lt;/P&gt;&lt;P&gt;Resident tempEPA;&lt;/P&gt;&lt;P&gt;drop table tempEPA;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Jul 2014 18:56:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Table-join-with-nested-if-statement/m-p/656885#M674451</guid>
      <dc:creator />
      <dc:date>2014-07-25T18:56:28Z</dc:date>
    </item>
    <item>
      <title>Re: Table join with nested if statement</title>
      <link>https://community.qlik.com/t5/QlikView/Table-join-with-nested-if-statement/m-p/656886#M674452</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Ruud&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you provide sample qvw file?&lt;/P&gt;&lt;P&gt;It would be easier to help you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Andrei&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Jul 2014 19:05:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Table-join-with-nested-if-statement/m-p/656886#M674452</guid>
      <dc:creator>crusader_</dc:creator>
      <dc:date>2014-07-25T19:05:20Z</dc:date>
    </item>
    <item>
      <title>Re: Table join with nested if statement</title>
      <link>https://community.qlik.com/t5/QlikView/Table-join-with-nested-if-statement/m-p/656887#M674453</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No I'm sorry, I've got the personal edition, I'll post some screenshots&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Jul 2014 21:10:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Table-join-with-nested-if-statement/m-p/656887#M674453</guid>
      <dc:creator />
      <dc:date>2014-07-25T21:10:21Z</dc:date>
    </item>
    <item>
      <title>Re: Table join with nested if statement</title>
      <link>https://community.qlik.com/t5/QlikView/Table-join-with-nested-if-statement/m-p/656888#M674454</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;After the tablejoin, the following expression in a graph table gives - as value while the expression seems to be OK:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SUM(if(Energielabel='A', (Maximumhuur_historisch*$(NormEPA-A)),&lt;/P&gt;&lt;P&gt;&amp;nbsp; if(Energielabel='B', (Maximumhuur_historisch*$(NormEPA-B)),&lt;/P&gt;&lt;P&gt;&amp;nbsp; if(Energielabel='C', (Maximumhuur_historisch*$(NormEPA-C)),&lt;/P&gt;&lt;P&gt;&amp;nbsp; if(Energielabel='D', (Maximumhuur_historisch*$(NormEPA-D)),&lt;/P&gt;&lt;P&gt;&amp;nbsp; if(Energielabel='E', (Maximumhuur_historisch*$(NormEPA-E)),&lt;/P&gt;&lt;P&gt;&amp;nbsp; if(Energielabel='F', (Maximumhuur_historisch*$(NormEPA-F)),&lt;/P&gt;&lt;P&gt;&amp;nbsp; if(Energielabel='G', (Maximumhuur_historisch*$(NormEPA-G)), (Maximumhuur_historisch*$(Streefnorm_overige))&lt;/P&gt;&lt;P&gt;&amp;nbsp; )))))))&lt;/P&gt;&lt;P&gt;)*12&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in the script VHE_EPA is defined as [Energielabel&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;HP_MAXHUUR as [Maximumhuur_historisch]&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 26 Jul 2014 18:39:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Table-join-with-nested-if-statement/m-p/656888#M674454</guid>
      <dc:creator />
      <dc:date>2014-07-26T18:39:11Z</dc:date>
    </item>
    <item>
      <title>Re: Table join with nested if statement</title>
      <link>https://community.qlik.com/t5/QlikView/Table-join-with-nested-if-statement/m-p/656889#M674455</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;It seems to me that expression is okay.&lt;/P&gt;&lt;P&gt;From your screenshots I can't find where do you define tempEPA table.&lt;/P&gt;&lt;P&gt;Your StreefhuurPerEPA table making Resident LOAD from tempEPA.&lt;/P&gt;&lt;P&gt;May be the problem is not in joining, but smth else?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;P&gt;Andrei&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 27 Jul 2014 10:09:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Table-join-with-nested-if-statement/m-p/656889#M674455</guid>
      <dc:creator>crusader_</dc:creator>
      <dc:date>2014-07-27T10:09:53Z</dc:date>
    </item>
    <item>
      <title>Re: Table join with nested if statement</title>
      <link>https://community.qlik.com/t5/QlikView/Table-join-with-nested-if-statement/m-p/656890#M674456</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've added some new screenshots, the idea is that in the collumn Streefhuur, Maximumhuur_historisch*corresponding NormEPA is visualised. The expression didn't work so I tried to calculate it in the load script. Energielabel is a field from a different xlsx file than Maximumhuur_historisch (hence the join). I thought that in Qlikview itself it wouldn't be a problem, but somehow it won't show any values. If I could avoid calculations in the load script that would be great, since the expression has to be flexible (The selected Year (Jaar can change and NormEPA is variable)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 27 Jul 2014 14:24:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Table-join-with-nested-if-statement/m-p/656890#M674456</guid>
      <dc:creator />
      <dc:date>2014-07-27T14:24:29Z</dc:date>
    </item>
    <item>
      <title>Re: Table join with nested if statement</title>
      <link>https://community.qlik.com/t5/QlikView/Table-join-with-nested-if-statement/m-p/656891#M674457</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, You can share the qvw file even though you have personal edition.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 27 Jul 2014 15:18:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Table-join-with-nested-if-statement/m-p/656891#M674457</guid>
      <dc:creator />
      <dc:date>2014-07-27T15:18:40Z</dc:date>
    </item>
    <item>
      <title>Re: Table join with nested if statement</title>
      <link>https://community.qlik.com/t5/QlikView/Table-join-with-nested-if-statement/m-p/656892#M674458</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;See attached&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 27 Jul 2014 15:56:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Table-join-with-nested-if-statement/m-p/656892#M674458</guid>
      <dc:creator />
      <dc:date>2014-07-27T15:56:18Z</dc:date>
    </item>
    <item>
      <title>Re: Table join with nested if statement</title>
      <link>https://community.qlik.com/t5/QlikView/Table-join-with-nested-if-statement/m-p/656893#M674459</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've solved it! Don't know why it went wrong there, but I deleted all the variables NormEPA en re-created them. Used the same expression and it worked... Strange but thanks for your replies!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 27 Jul 2014 18:43:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Table-join-with-nested-if-statement/m-p/656893#M674459</guid>
      <dc:creator />
      <dc:date>2014-07-27T18:43:38Z</dc:date>
    </item>
  </channel>
</rss>

