<?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: Need help with grouping in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Need-help-with-grouping/m-p/548156#M483346</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;have you tried something like:&lt;/P&gt;&lt;P&gt;count(if(LocationTo=base;0;1))&amp;nbsp; ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This should give you a count of all the lines where the "LocationTo" is not equal base. If I understood your problem, that's what you want?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Greeting Wiley_E&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 08 Jul 2013 08:27:15 GMT</pubDate>
    <dc:creator />
    <dc:date>2013-07-08T08:27:15Z</dc:date>
    <item>
      <title>Need help with grouping</title>
      <link>https://community.qlik.com/t5/QlikView/Need-help-with-grouping/m-p/548154#M483344</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hi All,&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;I have what I thought was a simple problem that has turned out to be a little trickier than expected and was hoping someone could assist. Basically I have a database of cars and them being hired out to "clients". The database consists of 2 tables of relevance.&lt;/DIV&gt;&lt;DIV&gt;1. The table of cars which includes its current location and a tonne of fields that are not required for this example.&lt;/DIV&gt;&lt;DIV&gt;&lt;TABLE border="1" cellpadding="3" cellspacing="0" class="jiveBorder" height="90" style="border: 1px solid #000000; width: 360px; height: 0px;" width="360"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Car ID&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Current Location&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;car1&lt;/TD&gt;&lt;TD&gt;base&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;car2&lt;/TD&gt;&lt;TD&gt;x&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;car3&lt;/TD&gt;&lt;TD&gt;y&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;2. A table of "events" on the car, including the location change.&lt;/DIV&gt;&lt;DIV&gt;&lt;TABLE border="1" cellpadding="3" cellspacing="0" class="jiveBorder" style="width: 100%; border: 1px solid #000000;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Car ID&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;LocationFrom&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;LocationTo&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="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t;/TD&gt;&lt;TD&gt;x&lt;/TD&gt;&lt;TD&gt;z&lt;/TD&gt;&lt;TD&gt;27/01/2013&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;car4&lt;/TD&gt;&lt;TD&gt;z&lt;/TD&gt;&lt;TD&gt;base&lt;/TD&gt;&lt;TD&gt;28/01/2013&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt; &lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;I want a chart (line graph or bar chart, not really fussed at this stage) that shows me month by month, how many cars were being "used" at the end of the month. The chart should show 3 months in this example as there is only 3 months worth of data. The numbers should be&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;Jan = 3 (car4 not included as it was back at base before the end of the month, the other 3 were out at clients)&lt;/DIV&gt;&lt;DIV&gt;Feb = 1 (car1 was the only car out at clients)&lt;/DIV&gt;&lt;DIV&gt;Mar = 0 (car1 was returned during the month)&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;I can't work out how to get the above results in qlikview though. A couple of issues being that in the above example car1 did not have an "event" in feb, it was at a client for all of feb.&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;I hope this makes sense, any help would be greatly appreciated&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Jul 2013 05:05:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-help-with-grouping/m-p/548154#M483344</guid>
      <dc:creator>diffeyj</dc:creator>
      <dc:date>2013-07-08T05:05:58Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with grouping</title>
      <link>https://community.qlik.com/t5/QlikView/Need-help-with-grouping/m-p/548155#M483345</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;on reflection I believe the 1st table in the above example is not relevent to this example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;added a very simple qlikview file with the inline statement done if it is useful for anyone&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Jul 2013 05:07:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-help-with-grouping/m-p/548155#M483345</guid>
      <dc:creator>diffeyj</dc:creator>
      <dc:date>2013-07-08T05:07:34Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with grouping</title>
      <link>https://community.qlik.com/t5/QlikView/Need-help-with-grouping/m-p/548156#M483346</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;have you tried something like:&lt;/P&gt;&lt;P&gt;count(if(LocationTo=base;0;1))&amp;nbsp; ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This should give you a count of all the lines where the "LocationTo" is not equal base. If I understood your problem, that's what you want?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Greeting Wiley_E&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Jul 2013 08:27:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-help-with-grouping/m-p/548156#M483346</guid>
      <dc:creator />
      <dc:date>2013-07-08T08:27:15Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with grouping</title>
      <link>https://community.qlik.com/t5/QlikView/Need-help-with-grouping/m-p/548157#M483347</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;oh... correction:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I just recognized, that my last answer would give you counts for the movements during the months....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;maybe you could combine the Count-statement above with a search for the "maximum" date stamp per month....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Greetings Wiley_E&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Jul 2013 08:30:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-help-with-grouping/m-p/548157#M483347</guid>
      <dc:creator />
      <dc:date>2013-07-08T08:30:15Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with grouping</title>
      <link>https://community.qlik.com/t5/QlikView/Need-help-with-grouping/m-p/548158#M483348</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Wiley_e_&lt;/P&gt;&lt;P&gt;thanx for the response, unfortunately the problem is that using the above example neither of these options would tell me that car1 was being used for March as it was out for over a month and there were no "events" in march&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Jul 2013 23:40:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-help-with-grouping/m-p/548158#M483348</guid>
      <dc:creator>diffeyj</dc:creator>
      <dc:date>2013-07-08T23:40:44Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with grouping</title>
      <link>https://community.qlik.com/t5/QlikView/Need-help-with-grouping/m-p/548159#M483349</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Attached is one possible solution. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The first step is to expand the events table into a row for every date in the interval.&amp;nbsp; Henric;s blog post&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" class="loading" href="https://community.qlik.com/blogs/qlikviewdesignblog/2013/02/05/populating-a-sparsely-populated-field"&gt;http://community.qlik.com/blogs/qlikviewdesignblog/2013/02/05/populating-a-sparsely-populated-field&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;describes this in detail. For this example, I used a QVC (&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://qlikviewcomponents.org"&gt;http://qlikviewcomponents.org&lt;/A&gt;&lt;SPAN&gt;) routine to expand the table:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; CALL Qvc.ExpandInterval('CarEvents', 'EffectiveDate', '', '[Car ID]');&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The next step is to flag the month end dates in the table. I chose to create a new field for those rows that have a month end date:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Right JOIN (CarEvents)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;LOAD Distinct *&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;,if(EffectiveDate = floor(MonthEnd(EffectiveDate)), date(EffectiveDate,'YYYY-MMM')) as &lt;STRONG&gt;MonthEnd&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;RESIDENT CarEvents&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At this point, you could summarize the &amp;lt;&amp;gt;base [Car ID] count in the script. I chose to do the counting in the chart, anticipating that you may want to use additonal selectons like "Make=Toyota".&amp;nbsp; The chart Dimension is the previously created "MonthEnd" field , the expression is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;=sum(0) +&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;count({&amp;lt;LocationTo=-{"base"}&amp;gt;}[Car ID])&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The sum(0) bit is a trick to force inclusion of the months that have zero cars.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://masterssummit.com"&gt;http://masterssummit.com&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://robwunderlich.com"&gt;http://robwunderlich.com&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Jul 2013 06:39:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-help-with-grouping/m-p/548159#M483349</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2013-07-09T06:39:08Z</dc:date>
    </item>
  </channel>
</rss>

