<?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 Date labeled column aggregation in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Date-labeled-column-aggregation/m-p/216028#M69428</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That works only for the first month. Once I input that command into the following months, I get a message error that "field names must be unique within table."&lt;/P&gt;&lt;P&gt;Each table is labeled as month and year. I need those connected or correlated so that when I review 2009, all data for all months of 2009 come up. Does that make sense? Sorry I am such a noob.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 27 Sep 2010 19:42:36 GMT</pubDate>
    <dc:creator />
    <dc:date>2010-09-27T19:42:36Z</dc:date>
    <item>
      <title>Date labeled column aggregation</title>
      <link>https://community.qlik.com/t5/QlikView/Date-labeled-column-aggregation/m-p/216024#M69424</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have 3 years of monthly data by branch of sales. Each column represents a month and year (January 2009, February 2009, March 2009, etc.). I want to aggregate the months into their corresponding years so that I could see the trend of sales for a particular branch year by year or all branches year by year. I cannot find how to use the Date#() or Year() functions when the date I need is the column label.&lt;/P&gt;&lt;P&gt;I tried each of these but got a script error, though the date#() function did recognize the correlation for the years, but the rest of my data did not load. Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Sep 2010 16:15:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-labeled-column-aggregation/m-p/216024#M69424</guid>
      <dc:creator />
      <dc:date>2010-09-23T16:15:18Z</dc:date>
    </item>
    <item>
      <title>Date labeled column aggregation</title>
      <link>https://community.qlik.com/t5/QlikView/Date-labeled-column-aggregation/m-p/216025#M69425</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;John,&lt;/P&gt;&lt;P&gt;If I understand correctly that the month year is text in the data source you can try using num(right(Month_Year,4)) to group your years. Though in my opinion it is usually healthier to change the data source so that is has real dates. (eg. January 2009 should be 2009-1-1). If that is not possible, you can do a complete transition from text to date format by mapping the values like below:&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;P&gt;&lt;/P&gt;Month_Map:&lt;BR /&gt;MAPPING LOAD * INLINE [&lt;BR /&gt; Month_Text, Month_Num&lt;BR /&gt; January, 1&lt;BR /&gt; February, 2 &lt;BR /&gt;];&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD makedate(num(right(Month_Year,4)) num(applymap('Month_Map',subfield(Month_Year,' ')))) as Date&lt;/P&gt;&lt;P&gt;etc...&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Sep 2010 16:48:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-labeled-column-aggregation/m-p/216025#M69425</guid>
      <dc:creator>pover</dc:creator>
      <dc:date>2010-09-23T16:48:27Z</dc:date>
    </item>
    <item>
      <title>Date labeled column aggregation</title>
      <link>https://community.qlik.com/t5/QlikView/Date-labeled-column-aggregation/m-p/216026#M69426</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You shouldn't need a mapping table since MMMM is the format code for the full name of the month. That should let you do this:&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;,date(date#(YourTextDateField,'MMMM YYYY'),'MMMM YYYY') as Month&lt;BR /&gt;,date(yearstart(date#(YourTextDateField,'MMMM YYYY')),'YYYY') as Year&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Sep 2010 01:40:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-labeled-column-aggregation/m-p/216026#M69426</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2010-09-24T01:40:05Z</dc:date>
    </item>
    <item>
      <title>Date labeled column aggregation</title>
      <link>https://community.qlik.com/t5/QlikView/Date-labeled-column-aggregation/m-p/216027#M69427</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good one, John.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Sep 2010 15:04:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-labeled-column-aggregation/m-p/216027#M69427</guid>
      <dc:creator>pover</dc:creator>
      <dc:date>2010-09-24T15:04:54Z</dc:date>
    </item>
    <item>
      <title>Date labeled column aggregation</title>
      <link>https://community.qlik.com/t5/QlikView/Date-labeled-column-aggregation/m-p/216028#M69428</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That works only for the first month. Once I input that command into the following months, I get a message error that "field names must be unique within table."&lt;/P&gt;&lt;P&gt;Each table is labeled as month and year. I need those connected or correlated so that when I review 2009, all data for all months of 2009 come up. Does that make sense? Sorry I am such a noob.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Sep 2010 19:42:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-labeled-column-aggregation/m-p/216028#M69428</guid>
      <dc:creator />
      <dc:date>2010-09-27T19:42:36Z</dc:date>
    </item>
    <item>
      <title>Date labeled column aggregation</title>
      <link>https://community.qlik.com/t5/QlikView/Date-labeled-column-aggregation/m-p/216029#M69429</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ah, I hadn't noticed that you had this data as columns instead of rows. So your input table looks like this?&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;Input:&lt;BR /&gt;Branch, January 2009, February 2009, March 2009, etc.&lt;BR /&gt;Eastern, 500, 600, 550, etc.&lt;BR /&gt;Western, 900, 800, 700, etc.&lt;/P&gt;&lt;P&gt;First thing to do is change those columns into rows:&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;FirstStep:&lt;BR /&gt;CROSSTABLE (MonthTemp, Sales)&lt;BR /&gt;LOAD *&lt;BR /&gt;RESIDENT Input&lt;BR /&gt;;&lt;BR /&gt;DROP TABLE Input&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;That should give you data that looks like this:&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;Branch, MonthTemp, Sales&lt;BR /&gt;Eastern, January 2009, 500&lt;BR /&gt;Eastern, February 2009, 600&lt;BR /&gt;Eastern, March 2009, 550&lt;BR /&gt;etc.&lt;BR /&gt;Western, January 2009, 900&lt;BR /&gt;Western, February 2009, 800&lt;BR /&gt;Western, March 2009, 700&lt;BR /&gt;etc.&lt;/P&gt;&lt;P&gt;It might look good, but our MonthTemp at this point is merely text, not an actual date field. But at least now the table is in a format where we can apply the expressions I gave:&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;SecondStep:&lt;BR /&gt;LOAD&lt;BR /&gt; Branch&lt;BR /&gt;,date(date#(MonthTemp,'MMMM YYYY'),'MMMM YYYY') as Month&lt;BR /&gt;,date(yearstart(date#(MonthTemp,'MMMM YYYY')),'YYYY') as Year&lt;BR /&gt;RESIDENT FirstStep&lt;BR /&gt;;&lt;BR /&gt;DROP TABLE FirstStep&lt;BR /&gt;;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Sep 2010 20:58:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-labeled-column-aggregation/m-p/216029#M69429</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2010-09-27T20:58:48Z</dc:date>
    </item>
    <item>
      <title>Date labeled column aggregation</title>
      <link>https://community.qlik.com/t5/QlikView/Date-labeled-column-aggregation/m-p/216030#M69430</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The first step worked beautifully. The second step, did not work in that there is not now an error message, just no values are available for year or month. So when I reload the script, I can select branch, month, and year but only branch populates with data; year and month are left blank.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Sep 2010 21:49:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-labeled-column-aggregation/m-p/216030#M69430</guid>
      <dc:creator />
      <dc:date>2010-09-27T21:49:18Z</dc:date>
    </item>
    <item>
      <title>Date labeled column aggregation</title>
      <link>https://community.qlik.com/t5/QlikView/Date-labeled-column-aggregation/m-p/216031#M69431</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, I forgot to load the Sales in the second step. Other than that, it works fine for the test data I posted. See attached.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Sep 2010 22:37:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-labeled-column-aggregation/m-p/216031#M69431</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2010-09-27T22:37:25Z</dc:date>
    </item>
  </channel>
</rss>

