<?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: Do join and then calculation in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Do-join-and-then-calculation/m-p/410029#M152493</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Jagan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I did that and the sum at Salesrep level &amp;amp; Project level comes out same. hence it is not working.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wonder if i need to aggregate to get a project level total.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 06 Mar 2013 16:58:22 GMT</pubDate>
    <dc:creator>userid128223</dc:creator>
    <dc:date>2013-03-06T16:58:22Z</dc:date>
    <item>
      <title>Do join and then calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Do-join-and-then-calculation/m-p/410022#M152486</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Everyone&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you please explain how following calculation can be done within script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have 2 tables that I have joined.&amp;nbsp; (default join = outerjoin)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ServiceDetails:&lt;/P&gt;&lt;P&gt;LOAD &lt;/P&gt;&lt;P&gt;CompanyName,&lt;/P&gt;&lt;P&gt;Salesrep,&lt;/P&gt;&lt;P&gt;HoursWorked,&lt;/P&gt;&lt;P&gt;ServiceDate,&lt;/P&gt;&lt;P&gt;Billable&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;FROM&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 10pt;"&gt;Table_1; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;// Join with above table&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;Join (ServiceDetails)&lt;/P&gt;&lt;P&gt;LOAD &lt;/P&gt;&lt;P&gt;CompanyName,&lt;/P&gt;&lt;P&gt;TimePurchasedDate,&lt;/P&gt;&lt;P&gt;TimePurchasedHours&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;FROM&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Table_2;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now lets say I want to do following calculation within script that I will be using number of times in my charts. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;if (BILLABLE = 'T' and ServiceDate &amp;gt;= ADDMONTHS(TODAY(),-18), HoursWorked, 0) as BillableHrs,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;if (BILLABLE = 'T' and TimePurchaseDate &amp;gt;= ADDMONTHS(TODAY(),-18), TimePurchasedHours, 0) as BillableTimePurchaseHrs;&lt;/EM&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;SPAN style="font-size: 14pt;"&gt;&lt;STRONG&gt;Questions:&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am confused to where the calculation part goes and how qlikview goes thru the code. Where fields are available to be used in futher processing. Where do I add above calculation within script. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;in table 1 ?&lt;/LI&gt;&lt;LI&gt;in table 2?&lt;/LI&gt;&lt;LI&gt;after table 2?&lt;/LI&gt;&lt;LI&gt;Before table 1 ?&lt;/LI&gt;&lt;LI&gt;Should I create a calculation table "Calculations:"and call these from resident Table1, since it is joined with Table2.&lt;/LI&gt;&lt;LI&gt;Whats the best approch.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can someone please also explain how qlikview code gets executed and when each field has a value that can be used in further calculations. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Mar 2013 16:40:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Do-join-and-then-calculation/m-p/410022#M152486</guid>
      <dc:creator>userid128223</dc:creator>
      <dc:date>2013-03-05T16:40:48Z</dc:date>
    </item>
    <item>
      <title>Re: Do join and then calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Do-join-and-then-calculation/m-p/410023#M152487</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;Try like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ServiceDetailsTemp:&lt;/P&gt;&lt;P&gt;LOAD &lt;/P&gt;&lt;P&gt;CompanyName,&lt;/P&gt;&lt;P&gt;Salesrep,&lt;/P&gt;&lt;P&gt;HoursWorked,&lt;/P&gt;&lt;P&gt;ServiceDate,&lt;/P&gt;&lt;P&gt;Billable&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;FROM&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 10pt;"&gt;Table_1; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;// Join with above table&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;Join (ServiceDetailsTemp)&lt;/P&gt;&lt;P&gt;LOAD &lt;/P&gt;&lt;P&gt;CompanyName,&lt;/P&gt;&lt;P&gt;TimePurchasedDate,&lt;/P&gt;&lt;P&gt;TimePurchasedHours&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;FROM&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Table_2;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ServiceDetails&lt;STRONG&gt;:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;LOAD &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; *,&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (&lt;/EM&gt;Billable&lt;EM&gt;= 'T' and ServiceDate &amp;gt;= ADDMONTHS(TODAY(),-18), HoursWorked, 0) as BillableHrs,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;if (&lt;/EM&gt;Billable&lt;EM&gt;= 'T' and TimePurchaseDate &amp;gt;= ADDMONTHS(TODAY(),-18), TimePurchasedHours, 0) as BillableTimePurchaseHrs&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;RESIDENT &lt;/EM&gt;ServiceDetailsTemp&lt;STRONG&gt;;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;DROP TABLE &lt;/STRONG&gt;ServiceDetailsTemp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jagan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Mar 2013 16:45:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Do-join-and-then-calculation/m-p/410023#M152487</guid>
      <dc:creator>jagan</dc:creator>
      <dc:date>2013-03-05T16:45:15Z</dc:date>
    </item>
    <item>
      <title>Re: Do join and then calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Do-join-and-then-calculation/m-p/410024#M152488</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the answer. For my understanding.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you please explain.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when are fields from tables 1 * 2 available for calculation within script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is it after table 1 gets loaded&lt;/P&gt;&lt;P&gt;is it after table 2 gets loaded&lt;/P&gt;&lt;P&gt;is it before both tables.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Mar 2013 17:29:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Do-join-and-then-calculation/m-p/410024#M152488</guid>
      <dc:creator>userid128223</dc:creator>
      <dc:date>2013-03-05T17:29:23Z</dc:date>
    </item>
    <item>
      <title>Re: Do join and then calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Do-join-and-then-calculation/m-p/410025#M152489</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;for example after I joined table 2 and did following would it work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;LOAD&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt; &lt;EM&gt;&amp;nbsp; &lt;/EM&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;&lt;EM&gt;if (&lt;/EM&gt;Billable&lt;EM&gt;= 'T' and ServiceDate &amp;gt;= ADDMONTHS(TODAY(),-18), HoursWorked, 0) as BillableHrs,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;&lt;EM&gt;if (&lt;/EM&gt;Billable&lt;EM&gt;= 'T' and TimePurchaseDate &amp;gt;= ADDMONTHS(TODAY(),-18), TimePurchasedHours, 0) as BillableTimePurchaseHrs;&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Mar 2013 17:32:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Do-join-and-then-calculation/m-p/410025#M152489</guid>
      <dc:creator>userid128223</dc:creator>
      <dc:date>2013-03-05T17:32:48Z</dc:date>
    </item>
    <item>
      <title>Re: Do join and then calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Do-join-and-then-calculation/m-p/410026#M152490</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In join statement it is not possible, because in the calculation you are using fields in both the tables.&amp;nbsp; Is the script given by me is working?&amp;nbsp; You have to do like that only.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jagan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Mar 2013 11:17:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Do-join-and-then-calculation/m-p/410026#M152490</guid>
      <dc:creator>jagan</dc:creator>
      <dc:date>2013-03-06T11:17:54Z</dc:date>
    </item>
    <item>
      <title>Re: Do join and then calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Do-join-and-then-calculation/m-p/410027#M152491</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Jagan &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It works. Another question regarding TOTALS calculations. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I use above table into a Pivot chart, I want to do totals by company which works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;however&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;when I do a subtotal on Project within Pivot table Presentation TAB. it does not work. it still gives me total by Company. Any way to fix this. Do I have to aggrigate.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Mar 2013 15:03:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Do-join-and-then-calculation/m-p/410027#M152491</guid>
      <dc:creator>userid128223</dc:creator>
      <dc:date>2013-03-06T15:03:50Z</dc:date>
    </item>
    <item>
      <title>Re: Do join and then calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Do-join-and-then-calculation/m-p/410028#M152492</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In Pivot Table -&amp;gt; Properties -&amp;gt; Presentation -&amp;gt; Select Dimension in Dimension and Expression -&amp;gt; Select Show Partial Sums.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this is what you are expecting.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jagan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Mar 2013 15:45:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Do-join-and-then-calculation/m-p/410028#M152492</guid>
      <dc:creator>jagan</dc:creator>
      <dc:date>2013-03-06T15:45:11Z</dc:date>
    </item>
    <item>
      <title>Re: Do join and then calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Do-join-and-then-calculation/m-p/410029#M152493</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Jagan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I did that and the sum at Salesrep level &amp;amp; Project level comes out same. hence it is not working.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wonder if i need to aggregate to get a project level total.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Mar 2013 16:58:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Do-join-and-then-calculation/m-p/410029#M152493</guid>
      <dc:creator>userid128223</dc:creator>
      <dc:date>2013-03-06T16:58:22Z</dc:date>
    </item>
  </channel>
</rss>

