<?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: Can I create distinct Month &amp; Year from loaded data ? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Can-I-create-distinct-Month-Year-from-loaded-data/m-p/494824#M1142441</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Thanks Michael, now I clicked on Number in Sort tab, it works.&amp;nbsp; Thanks agan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 06 Sep 2013 20:22:55 GMT</pubDate>
    <dc:creator />
    <dc:date>2013-09-06T20:22:55Z</dc:date>
    <item>
      <title>Can I create distinct Month &amp; Year from loaded data ?</title>
      <link>https://community.qlik.com/t5/QlikView/Can-I-create-distinct-Month-Year-from-loaded-data/m-p/494818#M1142435</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;I have already loaded 2 million records. Is there a way to create year &amp;amp; month from my doc_date ?&amp;nbsp; I have used month(doc_date) which returns the month but in many lines.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Sep 2013 19:51:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Can-I-create-distinct-Month-Year-from-loaded-data/m-p/494818#M1142435</guid>
      <dc:creator />
      <dc:date>2013-09-06T19:51:36Z</dc:date>
    </item>
    <item>
      <title>Re: Can I create distinct Month &amp; Year from loaded data ?</title>
      <link>https://community.qlik.com/t5/QlikView/Can-I-create-distinct-Month-Year-from-loaded-data/m-p/494819#M1142436</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this:&lt;/P&gt;&lt;P&gt;month(monthstart(doc_date)) as Month&lt;/P&gt;&lt;P&gt;year(yearstart(doc_date)) as Year&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Michael&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Sep 2013 20:00:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Can-I-create-distinct-Month-Year-from-loaded-data/m-p/494819#M1142436</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-09-06T20:00:04Z</dc:date>
    </item>
    <item>
      <title>Re: Can I create distinct Month &amp; Year from loaded data ?</title>
      <link>https://community.qlik.com/t5/QlikView/Can-I-create-distinct-Month-Year-from-loaded-data/m-p/494820#M1142437</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;LOAD &lt;STRONG&gt;distinct&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Month(doc_date) as Month&lt;/P&gt;&lt;P&gt;Resident Data;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Sep 2013 20:00:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Can-I-create-distinct-Month-Year-from-loaded-data/m-p/494820#M1142437</guid>
      <dc:creator>whiteline</dc:creator>
      <dc:date>2013-09-06T20:00:38Z</dc:date>
    </item>
    <item>
      <title>Re: Can I create distinct Month &amp; Year from loaded data ?</title>
      <link>https://community.qlik.com/t5/QlikView/Can-I-create-distinct-Month-Year-from-loaded-data/m-p/494821#M1142438</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot. It works. however the sorting happens on alphabetic order&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Sep 2013 20:06:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Can-I-create-distinct-Month-Year-from-loaded-data/m-p/494821#M1142438</guid>
      <dc:creator />
      <dc:date>2013-09-06T20:06:48Z</dc:date>
    </item>
    <item>
      <title>Re: Can I create distinct Month &amp; Year from loaded data ?</title>
      <link>https://community.qlik.com/t5/QlikView/Can-I-create-distinct-Month-Year-from-loaded-data/m-p/494822#M1142439</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use the Dual function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;Dual(Name, Num) As Month;&lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;/P&gt;&lt;P&gt;Num, Name&lt;/P&gt;&lt;P&gt;1, Jan&lt;/P&gt;&lt;P&gt;2, Feb&lt;/P&gt;&lt;P&gt;3, Mar&lt;/P&gt;&lt;P&gt;4, Apr&lt;/P&gt;&lt;P&gt;5, May&lt;/P&gt;&lt;P&gt;6, Jun&lt;/P&gt;&lt;P&gt;7, Jul&lt;/P&gt;&lt;P&gt;8, Aug&lt;/P&gt;&lt;P&gt;9, Sep&lt;/P&gt;&lt;P&gt;10, Oct&lt;/P&gt;&lt;P&gt;11, Nov&lt;/P&gt;&lt;P&gt;12, Dec&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Sep 2013 20:09:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Can-I-create-distinct-Month-Year-from-loaded-data/m-p/494822#M1142439</guid>
      <dc:creator>Larry_Aaron</dc:creator>
      <dc:date>2013-09-06T20:09:13Z</dc:date>
    </item>
    <item>
      <title>Re: Can I create distinct Month &amp; Year from loaded data ?</title>
      <link>https://community.qlik.com/t5/QlikView/Can-I-create-distinct-Month-Year-from-loaded-data/m-p/494823#M1142440</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Month() is a dual function by itself, should be sortable by numeric value.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Sep 2013 20:11:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Can-I-create-distinct-Month-Year-from-loaded-data/m-p/494823#M1142440</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-09-06T20:11:40Z</dc:date>
    </item>
    <item>
      <title>Re: Can I create distinct Month &amp; Year from loaded data ?</title>
      <link>https://community.qlik.com/t5/QlikView/Can-I-create-distinct-Month-Year-from-loaded-data/m-p/494824#M1142441</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Thanks Michael, now I clicked on Number in Sort tab, it works.&amp;nbsp; Thanks agan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Sep 2013 20:22:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Can-I-create-distinct-Month-Year-from-loaded-data/m-p/494824#M1142441</guid>
      <dc:creator />
      <dc:date>2013-09-06T20:22:55Z</dc:date>
    </item>
    <item>
      <title>Re: Can I create distinct Month &amp; Year from loaded data ?</title>
      <link>https://community.qlik.com/t5/QlikView/Can-I-create-distinct-Month-Year-from-loaded-data/m-p/494825#M1142442</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why the MonthStart() and the YearStart()?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 07 Sep 2013 00:24:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Can-I-create-distinct-Month-Year-from-loaded-data/m-p/494825#M1142442</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2013-09-07T00:24:35Z</dc:date>
    </item>
    <item>
      <title>Re: Can I create distinct Month &amp; Year from loaded data ?</title>
      <link>https://community.qlik.com/t5/QlikView/Can-I-create-distinct-Month-Year-from-loaded-data/m-p/494826#M1142443</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;try this in load statement&lt;/P&gt;&lt;P&gt;dual(month(date)&amp;amp;year(date),year(date)&amp;amp;month(date)) as Month_Year&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 07 Sep 2013 03:52:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Can-I-create-distinct-Month-Year-from-loaded-data/m-p/494826#M1142443</guid>
      <dc:creator />
      <dc:date>2013-09-07T03:52:43Z</dc:date>
    </item>
    <item>
      <title>Re: Can I create distinct Month &amp; Year from loaded data ?</title>
      <link>https://community.qlik.com/t5/QlikView/Can-I-create-distinct-Month-Year-from-loaded-data/m-p/494827#M1142444</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Rob,&lt;/P&gt;&lt;P&gt;I'd rather expected you to ask "why &lt;STRONG&gt;month&lt;/STRONG&gt;()"? &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&amp;nbsp; There is no need to use both month() and monthstart() here.&amp;nbsp; Any one of them should work, I'm not sure why month() didn't work properly at the first place, so suggested to try another approach.&lt;/P&gt;&lt;P&gt;The monthstart() converts all the dates values in one month to one single date.&amp;nbsp; Typically I use this in the script to create "Month and Year" field:&lt;/P&gt;&lt;P&gt;date(monthstart(DateField),'MMM-YY') as MonthYear&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pradas,&lt;/P&gt;&lt;P&gt;The expression above is more or less the same that you create with dual, but it is more effective - shorter, simpler, and utilizes the "natural dualism" of the date function.&amp;nbsp; The only possible downsize that it is if fact a date, the first date of a month - but if you think of it, it is an additional convenience for using in expressions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Michael&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Sep 2013 21:34:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Can-I-create-distinct-Month-Year-from-loaded-data/m-p/494827#M1142444</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-09-09T21:34:49Z</dc:date>
    </item>
    <item>
      <title>Re: Can I create distinct Month &amp; Year from loaded data ?</title>
      <link>https://community.qlik.com/t5/QlikView/Can-I-create-distinct-Month-Year-from-loaded-data/m-p/494828#M1142445</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Michael,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would disagree that either Month() or MonthStart() could be used here. It depends on how you want to group things. Month() returns only the month, not the year. MonthStart includes the year, and therefore is different. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Month('01/01/2013') = Month('01/01/2012')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MonthStart('01/01/2013') &amp;lt;&amp;gt; MonthStart('01/01/2012')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Sep 2013 19:51:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Can-I-create-distinct-Month-Year-from-loaded-data/m-p/494828#M1142445</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2013-09-10T19:51:17Z</dc:date>
    </item>
    <item>
      <title>Re: Can I create distinct Month &amp; Year from loaded data ?</title>
      <link>https://community.qlik.com/t5/QlikView/Can-I-create-distinct-Month-Year-from-loaded-data/m-p/494829#M1142446</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rob,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Certainly these functions are quite different, I've never said they are the same.&amp;nbsp; The month() function returns just a month name(number) from Jan(1) to Dec(12), while the monthstart() is the full date which can be formatted in any way.&amp;nbsp; So, month() often can be repalced with monthstart() with the appropriate formatting ('MMM'), at least for the presentation purpose, but not the other way around.&lt;BR /&gt;If &lt;A href="https://community.qlik.com/qlik-users/134401"&gt;Jayadevan V&lt;/A&gt; wants just the month name, any of these function can be used.&amp;nbsp; If he wants month and year, month() can't be used but monthstart() can.&amp;nbsp; Personally, I prefer using this for months:&lt;BR /&gt;date(monthstart(DateField),'MMM-YY') as MonthYear&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;BR /&gt;Michael&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Sep 2013 15:43:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Can-I-create-distinct-Month-Year-from-loaded-data/m-p/494829#M1142446</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-09-12T15:43:46Z</dc:date>
    </item>
  </channel>
</rss>

