<?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: problem with sum in nested expression in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/problem-with-sum-in-nested-expression/m-p/428056#M1161351</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 help with the aggr function&lt;/P&gt;&lt;P&gt;I had done wrong with the ().&lt;/P&gt;&lt;P&gt;the correct expression are as &lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; color: #ff8000; font-size: 9pt; font-family: 'Arial','sans-serif'; text-decoration: underline;"&gt;(&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: blue; font-size: 9pt;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: black; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: blue; font-size: 9pt;"&gt;aggr&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: black; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: blue; font-size: 9pt;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: black; font-size: 9pt;"&gt;({&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: maroon; font-size: 9pt;"&gt;[Kvantitet Enhet]&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: black; font-size: 9pt;"&gt; = {'Månad'}, &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: maroon; font-size: 9pt;"&gt;VECKOPER&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: black; font-size: 9pt;"&gt; = {'0'}&amp;gt;} &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: maroon; font-size: 9pt;"&gt;Kvantitet_Minuter&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: black; font-size: 9pt;"&gt;/30.31), &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: maroon; font-size: 9pt;"&gt;BESTNR&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: black; font-size: 9pt;"&gt;) * &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: blue; font-size: 9pt;"&gt;aggr&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: black; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: blue; font-size: 9pt;"&gt;count&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: black; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: blue; font-size: 9pt;"&gt;DISTINCT&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Arial','sans-serif'; color: maroon; font-size: 9pt;"&gt;Datum&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: black; font-size: 9pt;"&gt;), &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: maroon; font-size: 9pt;"&gt;BESTNR&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: black; font-size: 9pt;"&gt;)&lt;BR /&gt;)/60&lt;/SPAN&gt;&lt;STRONG style=": ; color: #ff8000; font-size: 9pt; font-family: 'Arial','sans-serif'; text-decoration: underline;"&gt;)&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: black; font-size: 9pt;"&gt;&lt;BR /&gt;+&lt;BR /&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: blue; font-size: 9pt;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: black; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: blue; font-size: 9pt;"&gt;aggr&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: black; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: blue; font-size: 9pt;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: black; font-size: 9pt;"&gt;({&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: maroon; font-size: 9pt;"&gt;[Kvantitet Enhet]&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: black; font-size: 9pt;"&gt; = {'Vecka'}, &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: maroon; font-size: 9pt;"&gt;VECKOPER&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: black; font-size: 9pt;"&gt; = {'2'}&amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: maroon; font-size: 9pt;"&gt;Kvantitet_Minuter&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: black; font-size: 9pt;"&gt; * 4.33 /30.31 /2), &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: maroon; font-size: 9pt;"&gt;BESTNR&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: black; font-size: 9pt;"&gt;) * &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: blue; font-size: 9pt;"&gt;aggr&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: black; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: blue; font-size: 9pt;"&gt;count&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: black; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: blue; font-size: 9pt;"&gt;DISTINCT&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Arial','sans-serif'; color: maroon; font-size: 9pt;"&gt;Datum&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: black; font-size: 9pt;"&gt;), &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: maroon; font-size: 9pt;"&gt;BESTNR&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: black; font-size: 9pt;"&gt;)&lt;BR /&gt;)/60) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 13 Nov 2012 12:43:14 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-11-13T12:43:14Z</dc:date>
    <item>
      <title>problem with sum in nested expression</title>
      <link>https://community.qlik.com/t5/QlikView/problem-with-sum-in-nested-expression/m-p/428048#M1161343</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Im having a problem with the sum in a expression. My goal is to sum the total value but to do that I have to add up diffrent set expression. I think it´s in this step the error occur. Maybe the expression should be written in another way, then please explain how this can be done, thanks. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Attache a qvd. Please set year to 2012 and month to nov and INSATS to 7. I also have include some textfield in the qvd to try to explain the problem&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edit: The expression simplyfied are as follow&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;SPAN style=": ; font-size: 1;"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;=((&lt;/P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;({&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Kvantitet Enhet]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = {'Vecka'}, &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;VECKOPER&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = {'2'}&amp;gt;} &lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Kvantitet_Minuter&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)* 4.33 /30.31 /2 *(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;count&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;DISTINCT&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Datum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;))&lt;BR /&gt;&lt;BR /&gt;+&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;({&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Kvantitet Enhet]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = {'Månad'}, &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;VECKOPER&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = {'0'}&amp;gt;} &lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Kvantitet_Minuter&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;/30.31) *&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;count&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;DISTINCT&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Datum&lt;/SPAN&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;)))&lt;BR /&gt;&lt;BR /&gt;/60&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; And with the data in the qvd it should be something as this - surly wrong with the ()&lt;SPAN style="font-size: 8pt;"&gt;&lt;/SPAN&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;&lt;SPAN style="font-size: 8pt;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;P&gt;=&lt;/P&gt;&lt;P&gt;sum(80 * 4.33) /30.31 /2 *30&lt;/P&gt;&lt;P&gt;+&lt;/P&gt;&lt;P&gt;sum((80 /30.31) *30))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;SPAN style=": ; font-size: 1;"&gt;&lt;P&gt;/60&lt;/P&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Nov 2012 10:14:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/problem-with-sum-in-nested-expression/m-p/428048#M1161343</guid>
      <dc:creator />
      <dc:date>2012-11-13T10:14:48Z</dc:date>
    </item>
    <item>
      <title>Re: problem with sum in nested expression</title>
      <link>https://community.qlik.com/t5/QlikView/problem-with-sum-in-nested-expression/m-p/428049#M1161344</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why do you need both sum and count. Do you want to count distinct datum or sum datum.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't think (but maybe Im wrong) you can use both sum and count in one expression like this refer manual start of 20.4 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I need to use both then I sometimes use aggr. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;say change&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;count&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;DISTINCT&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Datum&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;to something like&amp;nbsp; aggr (count(distinct Datum),by fields you want to count by))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;or you could obtain the appropriate count total by using count in script grouped by as appropriate&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Nov 2012 10:57:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/problem-with-sum-in-nested-expression/m-p/428049#M1161344</guid>
      <dc:creator>robert99</dc:creator>
      <dc:date>2012-11-13T10:57:40Z</dc:date>
    </item>
    <item>
      <title>Re: problem with sum in nested expression</title>
      <link>https://community.qlik.com/t5/QlikView/problem-with-sum-in-nested-expression/m-p/428050#M1161345</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;first. in the last exampel I was putting 30 insted of&amp;nbsp; 15 in the second part, correct should be&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum(80 * 4.33) /30.31 /2 *30&lt;/P&gt;&lt;P&gt;+&lt;/P&gt;&lt;P&gt;sum((80 /30.31) * 15))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/60&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The aim of the count(datum)&amp;nbsp; ie count(date) is to multiply the sum value with number of days in selected period. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The value "&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Kvantitet_Minuter&lt;/SPAN&gt;" ie time in min can be set in three diffrent units, min per day, min per week or min per month. I have to recalculate that value to min per singel day and then multiply it with number of days selected. &lt;/P&gt;&lt;P&gt;The FROM and TO period can also be part of a month so for thoose cases I also need to convert to time per day and the multiply with number of days for that period, even if the user select a hole month the period can be ie 15 days. And if the value are 100 min per month I need to convert it to days and then multiply with 15. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Should I explain in a better way or is´t understandable? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Nov 2012 11:09:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/problem-with-sum-in-nested-expression/m-p/428050#M1161345</guid>
      <dc:creator />
      <dc:date>2012-11-13T11:09:48Z</dc:date>
    </item>
    <item>
      <title>Re: problem with sum in nested expression</title>
      <link>https://community.qlik.com/t5/QlikView/problem-with-sum-in-nested-expression/m-p/428051#M1161346</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp; I tryed&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;=&lt;BR /&gt;((&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;({&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Kvantitet Enhet]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = {'Månad'}, &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;VECKOPER&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = {'0'}&amp;gt;} &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Kvantitet_Minuter&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;/30.31) *&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;aggr&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; (&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;count&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;distinct&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Datum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;),&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;BESTNR&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;))&lt;BR /&gt;&lt;BR /&gt;+&lt;BR /&gt;&lt;BR /&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;({&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Kvantitet Enhet]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = {'Vecka'}, &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;VECKOPER&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = {'2'}&amp;gt;} &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Kvantitet_Minuter&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)* 4.33 /30.31 /2 *&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;aggr&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; (&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;count&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;distinct&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Datum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;),&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;BESTNR&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;)))&lt;BR /&gt;&lt;BR /&gt;/60&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It gives me right result for each BESTNR, but no total sum&lt;/P&gt;&lt;P&gt;If I change BESTNR to antoher dimension it stills gives me wrong total sum. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Nov 2012 11:16:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/problem-with-sum-in-nested-expression/m-p/428051#M1161346</guid>
      <dc:creator />
      <dc:date>2012-11-13T11:16:05Z</dc:date>
    </item>
    <item>
      <title>Re: problem with sum in nested expression</title>
      <link>https://community.qlik.com/t5/QlikView/problem-with-sum-in-nested-expression/m-p/428052#M1161347</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hopefully someone else can help you out (Im still learning and have no time at present)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But when I have done similar I have either used &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-aggr (to get the appropriate count total) or &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-calculated the appropriate count total in script first&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But this may not work for you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Nov 2012 11:18:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/problem-with-sum-in-nested-expression/m-p/428052#M1161347</guid>
      <dc:creator>robert99</dc:creator>
      <dc:date>2012-11-13T11:18:09Z</dc:date>
    </item>
    <item>
      <title>Re: problem with sum in nested expression</title>
      <link>https://community.qlik.com/t5/QlikView/problem-with-sum-in-nested-expression/m-p/428053#M1161348</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;"It gives me right result for each BESTNR, but no total sum"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you take out the aggr expression and change to 1 say. Does it give the right sum based on 1&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Nov 2012 11:24:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/problem-with-sum-in-nested-expression/m-p/428053#M1161348</guid>
      <dc:creator>robert99</dc:creator>
      <dc:date>2012-11-13T11:24:43Z</dc:date>
    </item>
    <item>
      <title>Re: problem with sum in nested expression</title>
      <link>https://community.qlik.com/t5/QlikView/problem-with-sum-in-nested-expression/m-p/428054#M1161349</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When changed the aggr to 1 it gives right result so my problem seems to be in that part. Thanks for the help. Hopefully someone else can help me for here on.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I replace * (1) with *count(date) in the following expression so the total sum works? &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;=&lt;BR /&gt;(&lt;/P&gt;&lt;P&gt;(&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;({&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Kvantitet Enhet]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = {'Månad'}, &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;VECKOPER&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = {'0'}&amp;gt;} &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Kvantitet_Minuter&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;/30.31) * (1))&lt;BR /&gt;+&lt;BR /&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;({&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Kvantitet Enhet]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = {'Vecka'}, &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;VECKOPER&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = {'2'}&amp;gt;} &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Kvantitet_Minuter&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)* 4.33 /30.31 /2 * (1))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;)&lt;BR /&gt;/60 &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Nov 2012 11:54:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/problem-with-sum-in-nested-expression/m-p/428054#M1161349</guid>
      <dc:creator />
      <dc:date>2012-11-13T11:54:07Z</dc:date>
    </item>
    <item>
      <title>Re: problem with sum in nested expression</title>
      <link>https://community.qlik.com/t5/QlikView/problem-with-sum-in-nested-expression/m-p/428055#M1161350</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Strange&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;aggr&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; (&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;count&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;distinct&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Datum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;),&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;BESTNR&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;gives the right result and&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=((&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;({&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Kvantitet Enhet]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = {'Månad'}, &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;VECKOPER&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = {'0'}&amp;gt;} &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Kvantitet_Minuter&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;/30.31) * (1))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;does too based on 1&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;then when you replace the last 1 with &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;aggr&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; (&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;count&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;distinct&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Datum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;),&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;BESTNR&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) it should work I think&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;hopefully someone can give you a working solution as I would like to know what's wrong&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;You could calculate the date count in script&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Nov 2012 12:16:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/problem-with-sum-in-nested-expression/m-p/428055#M1161350</guid>
      <dc:creator>robert99</dc:creator>
      <dc:date>2012-11-13T12:16:41Z</dc:date>
    </item>
    <item>
      <title>Re: problem with sum in nested expression</title>
      <link>https://community.qlik.com/t5/QlikView/problem-with-sum-in-nested-expression/m-p/428056#M1161351</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 help with the aggr function&lt;/P&gt;&lt;P&gt;I had done wrong with the ().&lt;/P&gt;&lt;P&gt;the correct expression are as &lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; color: #ff8000; font-size: 9pt; font-family: 'Arial','sans-serif'; text-decoration: underline;"&gt;(&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: blue; font-size: 9pt;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: black; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: blue; font-size: 9pt;"&gt;aggr&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: black; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: blue; font-size: 9pt;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: black; font-size: 9pt;"&gt;({&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: maroon; font-size: 9pt;"&gt;[Kvantitet Enhet]&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: black; font-size: 9pt;"&gt; = {'Månad'}, &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: maroon; font-size: 9pt;"&gt;VECKOPER&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: black; font-size: 9pt;"&gt; = {'0'}&amp;gt;} &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: maroon; font-size: 9pt;"&gt;Kvantitet_Minuter&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: black; font-size: 9pt;"&gt;/30.31), &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: maroon; font-size: 9pt;"&gt;BESTNR&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: black; font-size: 9pt;"&gt;) * &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: blue; font-size: 9pt;"&gt;aggr&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: black; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: blue; font-size: 9pt;"&gt;count&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: black; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: blue; font-size: 9pt;"&gt;DISTINCT&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Arial','sans-serif'; color: maroon; font-size: 9pt;"&gt;Datum&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: black; font-size: 9pt;"&gt;), &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: maroon; font-size: 9pt;"&gt;BESTNR&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: black; font-size: 9pt;"&gt;)&lt;BR /&gt;)/60&lt;/SPAN&gt;&lt;STRONG style=": ; color: #ff8000; font-size: 9pt; font-family: 'Arial','sans-serif'; text-decoration: underline;"&gt;)&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: black; font-size: 9pt;"&gt;&lt;BR /&gt;+&lt;BR /&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: blue; font-size: 9pt;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: black; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: blue; font-size: 9pt;"&gt;aggr&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: black; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: blue; font-size: 9pt;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: black; font-size: 9pt;"&gt;({&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: maroon; font-size: 9pt;"&gt;[Kvantitet Enhet]&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: black; font-size: 9pt;"&gt; = {'Vecka'}, &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: maroon; font-size: 9pt;"&gt;VECKOPER&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: black; font-size: 9pt;"&gt; = {'2'}&amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: maroon; font-size: 9pt;"&gt;Kvantitet_Minuter&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: black; font-size: 9pt;"&gt; * 4.33 /30.31 /2), &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: maroon; font-size: 9pt;"&gt;BESTNR&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: black; font-size: 9pt;"&gt;) * &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: blue; font-size: 9pt;"&gt;aggr&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: black; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: blue; font-size: 9pt;"&gt;count&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: black; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: blue; font-size: 9pt;"&gt;DISTINCT&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Arial','sans-serif'; color: maroon; font-size: 9pt;"&gt;Datum&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: black; font-size: 9pt;"&gt;), &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: maroon; font-size: 9pt;"&gt;BESTNR&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: black; font-size: 9pt;"&gt;)&lt;BR /&gt;)/60) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Nov 2012 12:43:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/problem-with-sum-in-nested-expression/m-p/428056#M1161351</guid>
      <dc:creator />
      <dc:date>2012-11-13T12:43:14Z</dc:date>
    </item>
  </channel>
</rss>

