<?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 A simple maths question in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/A-simple-maths-question/m-p/152045#M29643</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi, but this is pow(0.99999,2) not a sum()&lt;/P&gt;&lt;P&gt;any ideas?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 13 Nov 2009 23:23:14 GMT</pubDate>
    <dc:creator>hector</dc:creator>
    <dc:date>2009-11-13T23:23:14Z</dc:date>
    <item>
      <title>A simple maths question</title>
      <link>https://community.qlik.com/t5/QlikView/A-simple-maths-question/m-p/152040#M29638</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;Sorry to ask a simple question like that, but I am a bit lost....&lt;/P&gt;&lt;P&gt;If I want to sum up data in a field, I use sum(field). How about *,- and / (times, minus and divide) the field??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Ivan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Nov 2009 22:41:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/A-simple-maths-question/m-p/152040#M29638</guid>
      <dc:creator />
      <dc:date>2009-11-13T22:41:41Z</dc:date>
    </item>
    <item>
      <title>A simple maths question</title>
      <link>https://community.qlik.com/t5/QlikView/A-simple-maths-question/m-p/152041#M29639</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is not a Qlikview question, but more a BI question...&lt;/P&gt;&lt;P&gt;I mean sum is used to aggregate your data.&lt;/P&gt;&lt;P&gt;In qlikview *, -, / and + are working ...&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sébastien&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Nov 2009 22:50:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/A-simple-maths-question/m-p/152041#M29639</guid>
      <dc:creator />
      <dc:date>2009-11-13T22:50:51Z</dc:date>
    </item>
    <item>
      <title>A simple maths question</title>
      <link>https://community.qlik.com/t5/QlikView/A-simple-maths-question/m-p/152042#M29640</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Spastor,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry to cause confusion, here is the example.&lt;/P&gt;&lt;P&gt;I have Year and month as teh dimenions in graph and sum(Sales) as the expression.&lt;/P&gt;&lt;P&gt;Sales is actually a daily figure. And what QV do here is to add up all daily sales amount and put group the under different year and months.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I reduce the dimenions by removing Months. All figures shown in table/graph is now yearly figure "ADD" by QV.&lt;/P&gt;&lt;P&gt;My question is, insteads of adding them, can I minus, time or divide them? (data in the same column).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Ivan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Nov 2009 23:00:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/A-simple-maths-question/m-p/152042#M29640</guid>
      <dc:creator />
      <dc:date>2009-11-13T23:00:57Z</dc:date>
    </item>
    <item>
      <title>A simple maths question</title>
      <link>https://community.qlik.com/t5/QlikView/A-simple-maths-question/m-p/152043#M29641</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hum.... I don't really understand what do you want to divide...&lt;/P&gt;&lt;P&gt;Please give me an example if possible.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Nov 2009 23:05:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/A-simple-maths-question/m-p/152043#M29641</guid>
      <dc:creator />
      <dc:date>2009-11-13T23:05:14Z</dc:date>
    </item>
    <item>
      <title>A simple maths question</title>
      <link>https://community.qlik.com/t5/QlikView/A-simple-maths-question/m-p/152044#M29642</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;A bit tricky to explain. Let use multiply as examply.&lt;/P&gt;&lt;P&gt;In the table, I have a field:"survivial rate". So let say our daily dead rate from accident is 0.00001 .Then for a random person, his chance to survive 2 day is 0.99999*0.99999. for one month, we need to multiply everyday surviving chance.&lt;/P&gt;&lt;P&gt;Does it help?&lt;/P&gt;&lt;P&gt;Ivan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Nov 2009 23:19:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/A-simple-maths-question/m-p/152044#M29642</guid>
      <dc:creator />
      <dc:date>2009-11-13T23:19:54Z</dc:date>
    </item>
    <item>
      <title>A simple maths question</title>
      <link>https://community.qlik.com/t5/QlikView/A-simple-maths-question/m-p/152045#M29643</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi, but this is pow(0.99999,2) not a sum()&lt;/P&gt;&lt;P&gt;any ideas?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Nov 2009 23:23:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/A-simple-maths-question/m-p/152045#M29643</guid>
      <dc:creator>hector</dc:creator>
      <dc:date>2009-11-13T23:23:14Z</dc:date>
    </item>
    <item>
      <title>A simple maths question</title>
      <link>https://community.qlik.com/t5/QlikView/A-simple-maths-question/m-p/152046#M29644</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;pow(sum(1-Rate),count(day)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Nov 2009 23:25:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/A-simple-maths-question/m-p/152046#M29644</guid>
      <dc:creator />
      <dc:date>2009-11-13T23:25:18Z</dc:date>
    </item>
    <item>
      <title>A simple maths question</title>
      <link>https://community.qlik.com/t5/QlikView/A-simple-maths-question/m-p/152047#M29645</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for everyone reply,&lt;/P&gt;&lt;P&gt;But not everyday having the same figures. They can be difference. Therefore, I can't use power.....&lt;/P&gt;&lt;P&gt;Ivan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Nov 2009 23:30:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/A-simple-maths-question/m-p/152047#M29645</guid>
      <dc:creator />
      <dc:date>2009-11-13T23:30:44Z</dc:date>
    </item>
    <item>
      <title>A simple maths question</title>
      <link>https://community.qlik.com/t5/QlikView/A-simple-maths-question/m-p/152048#M29646</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, that's annoying. I'd really have expected there to be an expression for the product of matching field values, but I see nothing under aggregation. Searches for "product", "sequence" and "pi" (since a capital pi is how it is expressed) turn up nothing useful either.&lt;/P&gt;&lt;P&gt;So we'll have to fake it. If all of your numbers are 1 or greater:&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;max(aggr(Number*if(len(above(column(1))),above(column(1)),1),RecNo))&lt;/P&gt;&lt;P&gt;If all of your numbers are between 0 and 1:&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;min(aggr(Number*if(len(above(column(1))),above(column(1)),1),RecNo))&lt;/P&gt;&lt;P&gt;I can't seem to work out the general case. I'd have expected either of these to work, but the first returns nothing, and the second seems to give me a "random" number from the product sequence rather than the last number:&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;bottom(aggr(Number*if(len(above(column(1))),above(column(1)),1),RecNo))&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;subfield(concat(aggr(Number*if(len(above(column(1))),above(column(1)),1),RecNo),','),',',count(RecNo))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 14 Nov 2009 02:53:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/A-simple-maths-question/m-p/152048#M29646</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2009-11-14T02:53:18Z</dc:date>
    </item>
    <item>
      <title>AW:A simple maths question</title>
      <link>https://community.qlik.com/t5/QlikView/A-simple-maths-question/m-p/152049#M29647</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;for the * there is a solution:#&lt;/P&gt;&lt;P&gt;exp(sum(log(field)))&lt;/P&gt;&lt;P&gt;For the other ones, I have to Think about it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards Alex&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Nov 2009 23:13:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/A-simple-maths-question/m-p/152049#M29647</guid>
      <dc:creator />
      <dc:date>2009-11-18T23:13:13Z</dc:date>
    </item>
    <item>
      <title>A simple maths question</title>
      <link>https://community.qlik.com/t5/QlikView/A-simple-maths-question/m-p/152050#M29648</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Thanks for the suggested answer. It is a right and simiar to what I have done. However, I can only do the * as well....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once again, thanks.&lt;/P&gt;&lt;P&gt;Ivan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Nov 2009 23:30:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/A-simple-maths-question/m-p/152050#M29648</guid>
      <dc:creator />
      <dc:date>2009-11-18T23:30:33Z</dc:date>
    </item>
    <item>
      <title>AW:A simple maths question</title>
      <link>https://community.qlik.com/t5/QlikView/A-simple-maths-question/m-p/152051#M29649</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Doh! How did I forget that you could use logarithms to turn a multiplication problem into an addition problem? I blame the lack of slide rules! The kids these days with their "calculators" and "computers" - they forget all their maths! &lt;IMG alt="Wink" src="http://community.qlik.com/emoticons/emotion-5.gif" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Nov 2009 23:35:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/A-simple-maths-question/m-p/152051#M29649</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2009-11-18T23:35:04Z</dc:date>
    </item>
    <item>
      <title>A simple maths question</title>
      <link>https://community.qlik.com/t5/QlikView/A-simple-maths-question/m-p/152052#M29650</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="jive_text_macro jive_macro_quote" jivemacro="quote"&gt;&lt;BR /&gt;ivanyeung wrote:However, I can only do the * as well....&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;OK, I'm not sure exactly what you mean by minus or divide in a case like this. If you subtract EVERY term, that's just -sum(field). Are you subtacting every other term or something? I guess I don't understand the requirement. As for division, are you starting with 1, and then dividing by every field in sequence? That's the same thing as multiplying by 1/field, so exp(sum(log(1/field))), I think?&lt;/P&gt;&lt;P&gt;(Edit: I continue to be dense. Exp(sum(log(1/field))) is the same as 1/exp(sum(log(field))), which would be faster to execute.)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Nov 2009 23:40:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/A-simple-maths-question/m-p/152052#M29650</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2009-11-18T23:40:21Z</dc:date>
    </item>
    <item>
      <title>AW:A simple maths question</title>
      <link>https://community.qlik.com/t5/QlikView/A-simple-maths-question/m-p/152053#M29651</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi again,&lt;/P&gt;&lt;P&gt;for the minus Problem, is sum(field*-1) what you want??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards Alex&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Nov 2009 23:40:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/A-simple-maths-question/m-p/152053#M29651</guid>
      <dc:creator />
      <dc:date>2009-11-18T23:40:58Z</dc:date>
    </item>
    <item>
      <title>A simple maths question</title>
      <link>https://community.qlik.com/t5/QlikView/A-simple-maths-question/m-p/152054#M29652</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Oh,&lt;/P&gt;&lt;P&gt;Yeah, how possible I know to use log, but forgot to use 1/field. It will give me '/'. Thanks.&lt;/P&gt;&lt;P&gt;Actually,what I need are '*' and '/'. Most of my data are time-series data. And I need to do some calculations which are not build-in by Qlikview. A simple example is the accumlated return on investment (compound return).&lt;/P&gt;&lt;P&gt;Also, I need to do use moving average (not exactly, but similar). E.g. Value at time (t) +/- Value at time (t-1) then divide by something across the whole time-period etc.&lt;/P&gt;&lt;P&gt;Thanks you very much for everyone's help!! &lt;IMG alt="Big Smile" src="http://community.qlik.com/emoticons/emotion-2.gif" /&gt;&lt;/P&gt;&lt;P&gt;Ivan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Nov 2009 00:00:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/A-simple-maths-question/m-p/152054#M29652</guid>
      <dc:creator />
      <dc:date>2009-11-19T00:00:00Z</dc:date>
    </item>
    <item>
      <title>A simple maths question</title>
      <link>https://community.qlik.com/t5/QlikView/A-simple-maths-question/m-p/152055#M29653</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In case this matters to anyone, I did some testing with "large" sequences of numbers very close to 1. On my antiquated machine, I'm still under half a second to multiply a million numbers, and about a second and a half to multiply ten million numbers. That seems pretty good to me. In any case, I doubt it would be possible to write an expression faster than the one Alex presented, since that's about as straightforward as things can get.&lt;/P&gt;&lt;P&gt;In any case, thanks Alex. I don't have any immediate need for this, but it's nice to have another useful tool available.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Nov 2009 00:22:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/A-simple-maths-question/m-p/152055#M29653</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2009-11-19T00:22:07Z</dc:date>
    </item>
  </channel>
</rss>

