<?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 Aggregating data with apply map in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Aggregating-data-with-apply-map/m-p/768258#M1033748</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am loading data from an excel file. I have a tab in the spreadsheet called "Events" , which includes the field names ServiceLine, CaseID, EventName and EventDate. I am focusing on one particular service line, but within that service line there are several case id's. Each case id has multiple EventNames and EventDates associated with it. My initial goal was to group the EventNames into smaller Stages, Get the Max EventDate for each Stage and then Create a field to calculate the number of days spent in each case. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I created a map on the EventName which groups the data into Stages. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Map1:&lt;/P&gt;&lt;P&gt;Mapping Load&lt;/P&gt;&lt;P&gt;* INLINE [&lt;/P&gt;&lt;P&gt;EventName,Stage&lt;/P&gt;&lt;P&gt;Initiate Call,Stage1&lt;/P&gt;&lt;P&gt;Complete Demographics,Stage1&lt;/P&gt;&lt;P&gt;Assign MA,Stage1&lt;/P&gt;&lt;P&gt;Intake Complete,Stage1&lt;/P&gt;&lt;P&gt;FBDC Accepted,Stage2&lt;/P&gt;&lt;P&gt;FBD Search Complete,Stage2&lt;/P&gt;&lt;P&gt;Report Delivery,Stage3&lt;/P&gt;&lt;P&gt;Client Reporting Date,Stage3&lt;/P&gt;&lt;P&gt;Soft Close Date,Stage4&lt;/P&gt;&lt;P&gt;Case Closed,Stage4];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;load &lt;/P&gt;&lt;P&gt;EventName,&lt;/P&gt;&lt;P&gt;ApplyMap('Map1', EventName, 'Not FBD') as Stage&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was able to calculate the Max EventDate in a straight table using the expression &lt;/P&gt;&lt;P&gt;aggr(max(EventDate),Stage). I refer to this as Stage Date&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was also able to get the number of days between each stage by using StageDate - above(total(StageDate))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The only issue is that it doesn't work when I have more than one case selected. How do I go about getting this information for each case? My end goal is to have a funnel chart which shows the average number of days spent in each stage for all of the cases within the serviceline.&amp;nbsp; My thinking is that I have to calculate the number of days at the case level first, sum that number and obtain the average. Am I even going in the right direction?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 26 Jan 2015 18:04:04 GMT</pubDate>
    <dc:creator />
    <dc:date>2015-01-26T18:04:04Z</dc:date>
    <item>
      <title>Aggregating data with apply map</title>
      <link>https://community.qlik.com/t5/QlikView/Aggregating-data-with-apply-map/m-p/768258#M1033748</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am loading data from an excel file. I have a tab in the spreadsheet called "Events" , which includes the field names ServiceLine, CaseID, EventName and EventDate. I am focusing on one particular service line, but within that service line there are several case id's. Each case id has multiple EventNames and EventDates associated with it. My initial goal was to group the EventNames into smaller Stages, Get the Max EventDate for each Stage and then Create a field to calculate the number of days spent in each case. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I created a map on the EventName which groups the data into Stages. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Map1:&lt;/P&gt;&lt;P&gt;Mapping Load&lt;/P&gt;&lt;P&gt;* INLINE [&lt;/P&gt;&lt;P&gt;EventName,Stage&lt;/P&gt;&lt;P&gt;Initiate Call,Stage1&lt;/P&gt;&lt;P&gt;Complete Demographics,Stage1&lt;/P&gt;&lt;P&gt;Assign MA,Stage1&lt;/P&gt;&lt;P&gt;Intake Complete,Stage1&lt;/P&gt;&lt;P&gt;FBDC Accepted,Stage2&lt;/P&gt;&lt;P&gt;FBD Search Complete,Stage2&lt;/P&gt;&lt;P&gt;Report Delivery,Stage3&lt;/P&gt;&lt;P&gt;Client Reporting Date,Stage3&lt;/P&gt;&lt;P&gt;Soft Close Date,Stage4&lt;/P&gt;&lt;P&gt;Case Closed,Stage4];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;load &lt;/P&gt;&lt;P&gt;EventName,&lt;/P&gt;&lt;P&gt;ApplyMap('Map1', EventName, 'Not FBD') as Stage&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was able to calculate the Max EventDate in a straight table using the expression &lt;/P&gt;&lt;P&gt;aggr(max(EventDate),Stage). I refer to this as Stage Date&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was also able to get the number of days between each stage by using StageDate - above(total(StageDate))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The only issue is that it doesn't work when I have more than one case selected. How do I go about getting this information for each case? My end goal is to have a funnel chart which shows the average number of days spent in each stage for all of the cases within the serviceline.&amp;nbsp; My thinking is that I have to calculate the number of days at the case level first, sum that number and obtain the average. Am I even going in the right direction?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Jan 2015 18:04:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggregating-data-with-apply-map/m-p/768258#M1033748</guid>
      <dc:creator />
      <dc:date>2015-01-26T18:04:04Z</dc:date>
    </item>
  </channel>
</rss>

