<?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: Two digit month number in expression in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Two-digit-month-number-in-expression/m-p/449725#M167832</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank You for the details&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 24 Oct 2012 19:11:38 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-10-24T19:11:38Z</dc:date>
    <item>
      <title>Two digit month number in expression</title>
      <link>https://community.qlik.com/t5/QlikView/Two-digit-month-number-in-expression/m-p/449721#M167828</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; I have a field ORDER_CANCEL_DT and would like to use this as Year-Month in a pivot table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Here is what I tried as my "Calculated Expression"&lt;/P&gt;&lt;P&gt;Year(ORDER_CANCEL_DT)&amp;amp;'-'&amp;amp;Month(ORDER_CANCEL_DT)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But the issue is it messes up the sorting&lt;/P&gt;&lt;P&gt;2012-1 , then 2012-10 , then 2012-2 and so on&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 98px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl63" height="17" width="98"&gt;2012-1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="17" style="border-top: none;"&gt;2012-10&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="17" style="border-top: none;"&gt;2012-2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="17" style="border-top: none;"&gt;2012-3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="17" style="border-top: none;"&gt;2012-4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="17" style="border-top: none;"&gt;2012-5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="17" style="border-top: none;"&gt;2012-6&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="17" style="border-top: none;"&gt;2012-7&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="17" style="border-top: none;"&gt;2012-8&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="17" style="border-top: none;"&gt;2012-9&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any way we could extrract the two digit month from a date field?&lt;/P&gt;&lt;P&gt;ex. 2012-01, 2012-02 and so forth?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Aji Paul.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Oct 2012 18:22:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Two-digit-month-number-in-expression/m-p/449721#M167828</guid>
      <dc:creator />
      <dc:date>2012-10-24T18:22:48Z</dc:date>
    </item>
    <item>
      <title>Re: Two digit month number in expression</title>
      <link>https://community.qlik.com/t5/QlikView/Two-digit-month-number-in-expression/m-p/449722#M167829</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;Year(ORDER_CANCEL_DT)&amp;amp;'-'&amp;amp; num( Month(ORDER_CANCEL_DT), '00')&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but I would suggest to use a formatted date:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Date( monthstart(ORDER_CANCEL_DT), 'YYYY-MM')&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Oct 2012 18:27:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Two-digit-month-number-in-expression/m-p/449722#M167829</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-10-24T18:27:26Z</dc:date>
    </item>
    <item>
      <title>Re: Two digit month number in expression</title>
      <link>https://community.qlik.com/t5/QlikView/Two-digit-month-number-in-expression/m-p/449723#M167830</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Awesome! &lt;/P&gt;&lt;P&gt;Thank You verymuch!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Oct 2012 18:32:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Two-digit-month-number-in-expression/m-p/449723#M167830</guid>
      <dc:creator />
      <dc:date>2012-10-24T18:32:41Z</dc:date>
    </item>
    <item>
      <title>Re: Two digit month number in expression</title>
      <link>https://community.qlik.com/t5/QlikView/Two-digit-month-number-in-expression/m-p/449724#M167831</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;You could use Num() to change text format: Num(Month(ORDER_CANCEL_DT), '00')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Actually, you don't have to construct a string representation for your date manually.&lt;/P&gt;&lt;P&gt;Use formatting functions Date() and so on.&lt;/P&gt;&lt;P&gt;The only thing you should keep in mind is that there is numeric value and text representation of dates.&lt;/P&gt;&lt;P&gt;Formatting functions don't change the numeric value.&lt;/P&gt;&lt;P&gt;So if you want to discard the days information in text representation you should also discard it from numeric value.&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;P&gt;Date(MonthName(ORDER_CANCEL_DT), 'YYYY-MM')&lt;/P&gt;&lt;P&gt;MonthName - discards days, replacing it with 01 and change text format.&lt;/P&gt;&lt;P&gt;Date - changes the format again.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Oct 2012 18:33:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Two-digit-month-number-in-expression/m-p/449724#M167831</guid>
      <dc:creator>whiteline</dc:creator>
      <dc:date>2012-10-24T18:33:17Z</dc:date>
    </item>
    <item>
      <title>Re: Two digit month number in expression</title>
      <link>https://community.qlik.com/t5/QlikView/Two-digit-month-number-in-expression/m-p/449725#M167832</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank You for the details&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Oct 2012 19:11:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Two-digit-month-number-in-expression/m-p/449725#M167832</guid>
      <dc:creator />
      <dc:date>2012-10-24T19:11:38Z</dc:date>
    </item>
    <item>
      <title>Re: Two digit month number in expression</title>
      <link>https://community.qlik.com/t5/QlikView/Two-digit-month-number-in-expression/m-p/1640608#M447148</link>
      <description>&lt;P&gt;Dear Stefan,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;many thanks! Sometimes &lt;SPAN&gt;small tweaks have the greatest effect!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Jan&lt;/P&gt;</description>
      <pubDate>Tue, 29 Oct 2019 06:34:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Two-digit-month-number-in-expression/m-p/1640608#M447148</guid>
      <dc:creator>JaWa</dc:creator>
      <dc:date>2019-10-29T06:34:22Z</dc:date>
    </item>
  </channel>
</rss>

