<?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: Best practice in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Best-practice/m-p/471929#M176236</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;As per &lt;A _jive_internal="true" class="jiveTT-hover-user jive-username-link" href="https://community.qlik.com/people/maxim.senin" id="jive-7541217574705201168835"&gt;Maxim Senin&lt;/A&gt; suggestion it is better to calculate Salesprice, CostPrice and profit in the script itself, so that there is no need to calculate this during runtime, this improves performance of the charts.&amp;nbsp; Alos the expressions would be simpler like &lt;/P&gt;&lt;P&gt;=Sum(Profit)&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>Mon, 25 Mar 2013 07:11:01 GMT</pubDate>
    <dc:creator>jagan</dc:creator>
    <dc:date>2013-03-25T07:11:01Z</dc:date>
    <item>
      <title>Best practice</title>
      <link>https://community.qlik.com/t5/QlikView/Best-practice/m-p/471926#M176233</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;I've a formula sum(QTY*Price - QTY*Cost).&amp;nbsp; Which are the Best practice rules for write this better ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it possible by the following formula :&lt;/P&gt;&lt;P&gt;sum(QTY(Price-Cost)) or&amp;nbsp; sum(QTY*Price) - sum(QTY*Cost)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Who can give me the best solution, maybe there is another one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&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;Else&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 24 Mar 2013 13:43:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Best-practice/m-p/471926#M176233</guid>
      <dc:creator />
      <dc:date>2013-03-24T13:43:22Z</dc:date>
    </item>
    <item>
      <title>Re: Best practice</title>
      <link>https://community.qlik.com/t5/QlikView/Best-practice/m-p/471927#M176234</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Else,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's better to estimate your data model before saying whether some expression is correct, then it will be possible to say whether it corresponds to "best practice" (b.p.).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I assume you have a table of (e.g.) sales with "Good" dimension and values of "Qty", "Price", "Cost". If you need to define a profit the correct expression would be Qty*Price - Qty*Cost or Qty*(Price-Cost). At least such expression would work in Excel. In QlikView of course you should use the expression with Sum() aggregation function in order to be able to have a profit in any dimension(s), if you have some others except "Good".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As for the expression Sum(Qty*Price)-Sum(Qty*Cost) - what its purpose is?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As for b.p., I'm not sure the b.p. covers this case, it states that expressions shall be as short and simple as possible, i.e. in this case it's better, for instance, to calculate saleRevenue = Qty*Price and saleCost = Qty*Cost for each sale in&amp;nbsp; load script, so your expression will look like Sum(saleRevenue-saleCost), or you can calculate saleProfit = Qty*Price - Qty*Cost in the load script, and your expression will be Sum(saleProfit).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At least that is my understanding of b.p., as for writing of expressions - it's important to understand their purpose.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Maxim&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 24 Mar 2013 23:03:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Best-practice/m-p/471927#M176234</guid>
      <dc:creator>maksim_senin</dc:creator>
      <dc:date>2013-03-24T23:03:56Z</dc:date>
    </item>
    <item>
      <title>Re: Best practice</title>
      <link>https://community.qlik.com/t5/QlikView/Best-practice/m-p/471928#M176235</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Maxim,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your answer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's a colleague of me who asked the question.&amp;nbsp; He isn't a developer, so I think he will do it in the expression-tab of the Bar Chart.&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;Else&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Mar 2013 06:53:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Best-practice/m-p/471928#M176235</guid>
      <dc:creator />
      <dc:date>2013-03-25T06:53:56Z</dc:date>
    </item>
    <item>
      <title>Re: Best practice</title>
      <link>https://community.qlik.com/t5/QlikView/Best-practice/m-p/471929#M176236</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;As per &lt;A _jive_internal="true" class="jiveTT-hover-user jive-username-link" href="https://community.qlik.com/people/maxim.senin" id="jive-7541217574705201168835"&gt;Maxim Senin&lt;/A&gt; suggestion it is better to calculate Salesprice, CostPrice and profit in the script itself, so that there is no need to calculate this during runtime, this improves performance of the charts.&amp;nbsp; Alos the expressions would be simpler like &lt;/P&gt;&lt;P&gt;=Sum(Profit)&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>Mon, 25 Mar 2013 07:11:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Best-practice/m-p/471929#M176236</guid>
      <dc:creator>jagan</dc:creator>
      <dc:date>2013-03-25T07:11:01Z</dc:date>
    </item>
  </channel>
</rss>

