<?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 problem in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Calculation-problem/m-p/806040#M473080</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't quite understand what you're trying to do. Can you give a concrete example with source data and the expected results? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 24 Nov 2014 10:26:37 GMT</pubDate>
    <dc:creator>Gysbert_Wassenaar</dc:creator>
    <dc:date>2014-11-24T10:26:37Z</dc:date>
    <item>
      <title>Calculation problem</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-problem/m-p/806039#M473079</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;I have an Excel list where, in one field, I have a list of values, separated by commas - the number of values there can differ greatly, one day it is 12, the next time (still on the same day) it is 110 and so on.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The difficulty is: In a subroutine, I turn that into as many records as I have values in that field - 12 records out of 1 to stick with the example and 110 out of the next one.&lt;/P&gt;&lt;P&gt;=&amp;gt; I cannot simply sum this up, I'd get an enormous number.&lt;/P&gt;&lt;P&gt;Using &amp;gt;&amp;gt; &lt;STRONG&gt;Sum(DISTINCT)&lt;/STRONG&gt;&amp;nbsp; &amp;lt;&amp;lt; would solve that problem.&lt;BR /&gt;&amp;lt;=&amp;gt; If by chance I got two records with the same number of values in that field, that would be wrong again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What can I do to avoid both those pitfalls?&lt;/P&gt;&lt;P&gt;I have a unique line_ID - can I use a set_expression or sth. so that the number belonging to one unique line_ID is counted only once?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot!&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;DataNibbler&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Nov 2014 10:16:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-problem/m-p/806039#M473079</guid>
      <dc:creator>datanibbler</dc:creator>
      <dc:date>2014-11-24T10:16:50Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation problem</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-problem/m-p/806040#M473080</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't quite understand what you're trying to do. Can you give a concrete example with source data and the expected results? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Nov 2014 10:26:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-problem/m-p/806040#M473080</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2014-11-24T10:26:37Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Calculation problem</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-problem/m-p/806041#M473081</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gysbert,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sure. I attach a small sample file where you see exactly what my problem is:&lt;/P&gt;&lt;P&gt;- On one day, there were 4 checks, with 3 different numbers of items checked.&lt;/P&gt;&lt;P&gt;=&amp;gt; In my subroutine, I make each of those 4 records into as many records as I have items.&lt;/P&gt;&lt;P&gt;=&amp;gt; Obviously, I cannot sum them up. A SUM(DISTINCT) would work if I had only records 1 to 3 - but as it is, it won't work - it would ignore record #4 as it has the same nr. of items as record #1.&lt;/P&gt;&lt;P&gt;I could calculate it in the script.&lt;/P&gt;&lt;P&gt;&amp;lt;=&amp;gt; Is there an easier way?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Nov 2014 10:50:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-problem/m-p/806041#M473081</guid>
      <dc:creator>datanibbler</dc:creator>
      <dc:date>2014-11-24T10:50:05Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Re: Calculation problem</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-problem/m-p/806042#M473082</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Perhaps something like in the attached qvw.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Nov 2014 10:56:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-problem/m-p/806042#M473082</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2014-11-24T10:56:25Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Calculation problem</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-problem/m-p/806043#M473083</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hi Gysbert,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;yes. I was thinking of something like this - but if I hard-code a line_ID in the set_expression, I would need approx. 1000 expressions ...&lt;/P&gt;&lt;P&gt;Isn't there a way to tell QlikView - on the GUI - to not add up anymore numbers if the line_ID is the same as above? Alternatively, I could do it in the script - I could populate every record with the same date with the total nr. of items checked - all 4 checks included - and then just use ONLY() or avg() on the GUI to display that.&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DataNibbler&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Nov 2014 11:05:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-problem/m-p/806043#M473083</guid>
      <dc:creator>datanibbler</dc:creator>
      <dc:date>2014-11-24T11:05:12Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation problem</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-problem/m-p/806044#M473084</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;yes. I was thinking of something like this - but if I hard-code a line_ID in the set_expression, I would need approx. 1000 expressions ...&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Why? Each Check in my example has exactly one ItemID with value 1. That's all that's necessary to be able to sum the values.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Nov 2014 11:18:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-problem/m-p/806044#M473084</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2014-11-24T11:18:37Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Calculation problem</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-problem/m-p/806045#M473085</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Ah. Now I see what you are doing. I've looked at the script.&lt;/P&gt;&lt;P&gt;Only, I've done it in a slightly different way - I have a subroutine which calculates the number_of_items_checked, so I cannot create a WHILE_loop for this, so I cannot use Iterno(). Would be a very good idea otherwise.&lt;/P&gt;&lt;P&gt;I guess I'll try to ´calculate this in the script - I think I know how to do that.&lt;/P&gt;&lt;P&gt;Thanks a lot anyway!&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DataNibbler&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Nov 2014 12:17:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-problem/m-p/806045#M473085</guid>
      <dc:creator>datanibbler</dc:creator>
      <dc:date>2014-11-24T12:17:52Z</dc:date>
    </item>
  </channel>
</rss>

