<?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: calculation in Script from two sources in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/calculation-in-Script-from-two-sources/m-p/992568#M467680</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;mmm .... It's weird because I do not see an error when adding the data, I do this by using a binary since I do not have access to the data source&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;though instead of using a left join I just reloaded the data under a temp and then renamed it&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;temp:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp; *,&lt;/P&gt;&lt;P&gt;&amp;nbsp; if(lastdepnyear=0,[ND Comet], if([ND Comet]&amp;gt;((lastdepnyear-CometYear)*12+lastdepnper-CometPer+1),[ND Comet]-((lastdepnyear-CometYear)*12+lastdepnper-CometPer+1),0)) as [RND Comet]&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Resident Assets;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;drop table Assets;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RENAME Table temp to Assets;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 29 Oct 2015 18:03:47 GMT</pubDate>
    <dc:creator>ramoncova06</dc:creator>
    <dc:date>2015-10-29T18:03:47Z</dc:date>
    <item>
      <title>calculation in Script from two sources</title>
      <link>https://community.qlik.com/t5/QlikView/calculation-in-Script-from-two-sources/m-p/992563#M467675</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;maybe someone of you can help me.&lt;/P&gt;&lt;P&gt;I loaded data from two different sources into qlikview.&lt;/P&gt;&lt;P&gt;First I loaded a table 'Assets'. Afterwards I loaded the second table via left join (Assets).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I needed to create a calculation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt;// ,if(lastdepnyear=0,[Comet (Monate)], if([Comet (Monate)]&amp;gt;((lastdepnyear-CometYear)*12+lastdepnper-CometPer+1),[Comet (Monate)]-((lastdepnyear-CometYear)*12+lastdepnper-CometPer+1),0)) as [RND Comet] &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Everything with "Comet..." was within the first load, the "lastdepn..." were part of the second load.&lt;/P&gt;&lt;P&gt;This code does not work. I get the message, that the Comet...-Fields could not be found.&lt;/P&gt;&lt;P&gt;I think it has something to do with "What is already in Memory and what not"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where in the script do I have to do this? Can you help me with the Syntax?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2015 15:05:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/calculation-in-Script-from-two-sources/m-p/992563#M467675</guid>
      <dc:creator />
      <dc:date>2015-10-29T15:05:19Z</dc:date>
    </item>
    <item>
      <title>Re: calculation in Script from two sources</title>
      <link>https://community.qlik.com/t5/QlikView/calculation-in-Script-from-two-sources/m-p/992564#M467676</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;can you add the loading script including the left join piece &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2015 15:14:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/calculation-in-Script-from-two-sources/m-p/992564#M467676</guid>
      <dc:creator>ramoncova06</dc:creator>
      <dc:date>2015-10-29T15:14:48Z</dc:date>
    </item>
    <item>
      <title>Re: calculation in Script from two sources</title>
      <link>https://community.qlik.com/t5/QlikView/calculation-in-Script-from-two-sources/m-p/992565#M467677</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ramon,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried several things but nothing worked.&lt;/P&gt;&lt;P&gt;Would you please write down how it should look like [I am not an IT Guy].&lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/sad.png" /&gt;&lt;/P&gt;&lt;P&gt;I will try to get the Infos into a qvd and attach this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2015 15:18:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/calculation-in-Script-from-two-sources/m-p/992565#M467677</guid>
      <dc:creator />
      <dc:date>2015-10-29T15:18:56Z</dc:date>
    </item>
    <item>
      <title>Re: calculation in Script from two sources</title>
      <link>https://community.qlik.com/t5/QlikView/calculation-in-Script-from-two-sources/m-p/992566#M467678</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can do it by joining the two tables in memory into a temp table and then loading the temp table and formula into a final table. Here is some pseudo-code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//Loads the first table into a temp table (Table1Tmp)&lt;/P&gt;&lt;P&gt;Table1Tmp:&lt;BR /&gt;LOAD field1, field2&lt;BR /&gt;FROM sometable;&lt;/P&gt;&lt;P&gt;//Joins the second table - in this case field1 is the common key field &lt;/P&gt;&lt;P&gt;JOIN&lt;/P&gt;&lt;P&gt;LOAD field1, field3&lt;BR /&gt;FROM someothertable;&lt;/P&gt;&lt;P&gt;NOCONCATENATE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//Your Table1Tmp should have 3 fields now: field1, field2, field3&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//Now load Table1Tmp into a final table (NewTable), including a calculation (I used a simple IF statement for example)&lt;BR /&gt;NewTable:&lt;BR /&gt;LOAD *, If(field2=field3,1,0) AS myCalculation&lt;/P&gt;&lt;P&gt;FROM RESIDENT Table1Tmp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//Drop the temp table, as it's not needed and will likely mess with wanted relationships&lt;/P&gt;&lt;P&gt;DROP TABLE1Tmp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2015 15:45:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/calculation-in-Script-from-two-sources/m-p/992566#M467678</guid>
      <dc:creator />
      <dc:date>2015-10-29T15:45:59Z</dc:date>
    </item>
    <item>
      <title>Re: calculation in Script from two sources</title>
      <link>https://community.qlik.com/t5/QlikView/calculation-in-Script-from-two-sources/m-p/992567#M467679</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ramon,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please find attached the qvw-file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2015 15:47:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/calculation-in-Script-from-two-sources/m-p/992567#M467679</guid>
      <dc:creator />
      <dc:date>2015-10-29T15:47:11Z</dc:date>
    </item>
    <item>
      <title>Re: calculation in Script from two sources</title>
      <link>https://community.qlik.com/t5/QlikView/calculation-in-Script-from-two-sources/m-p/992568#M467680</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;mmm .... It's weird because I do not see an error when adding the data, I do this by using a binary since I do not have access to the data source&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;though instead of using a left join I just reloaded the data under a temp and then renamed it&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;temp:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp; *,&lt;/P&gt;&lt;P&gt;&amp;nbsp; if(lastdepnyear=0,[ND Comet], if([ND Comet]&amp;gt;((lastdepnyear-CometYear)*12+lastdepnper-CometPer+1),[ND Comet]-((lastdepnyear-CometYear)*12+lastdepnper-CometPer+1),0)) as [RND Comet]&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Resident Assets;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;drop table Assets;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RENAME Table temp to Assets;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2015 18:03:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/calculation-in-Script-from-two-sources/m-p/992568#M467680</guid>
      <dc:creator>ramoncova06</dc:creator>
      <dc:date>2015-10-29T18:03:47Z</dc:date>
    </item>
    <item>
      <title>Re: calculation in Script from two sources</title>
      <link>https://community.qlik.com/t5/QlikView/calculation-in-Script-from-two-sources/m-p/992569#M467681</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ramon,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thank you I will try this as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Oct 2015 07:55:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/calculation-in-Script-from-two-sources/m-p/992569#M467681</guid>
      <dc:creator />
      <dc:date>2015-10-30T07:55:22Z</dc:date>
    </item>
    <item>
      <title>Re: calculation in Script from two sources</title>
      <link>https://community.qlik.com/t5/QlikView/calculation-in-Script-from-two-sources/m-p/992570#M467682</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Brent,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;very much thanks for the Details. I will try this also.&lt;/P&gt;&lt;P&gt;We will see what will work &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/wink.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Oct 2015 07:56:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/calculation-in-Script-from-two-sources/m-p/992570#M467682</guid>
      <dc:creator />
      <dc:date>2015-10-30T07:56:17Z</dc:date>
    </item>
  </channel>
</rss>

