Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
The #1 reason QlikView customers adopt Qlik Sense is a desire for a modern BI experience. Read More
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Specialist
Specialist

Convert Dates into month and year

Hi friends,

I have a Date Column.

trade_date
2015-03-01
2015-03-07
2015-04-06
2015-04-02
2015-04-01
2014-12-23
2014-12-14

I want out put as

output
Mar 2015
Apr 2015
Dec 2014

When I select Mar 2015, data of all dates of march should be selected.

Help

7 Replies
Highlighted

Hi,

use Monthname()

or

date(datefield,'MMM YYYY')

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Specialist II
Specialist II

First you need to check if your dates are in date format or not.

if they are in date format and you need to include one more column in script

load

Trade_date,

MonthName(Trade_date) as MonthYear


from table;


Now you can use this field as list box for filtering the data. And when you will select one month it will select all the dates for that particular month Year .


Thanks

BKC

Highlighted
Not applicable

Hi Saumya,

is trade_date a proper date or a string?

If it's not a proper date you'll need to use date#

Date(Date#(trade_date, 'YYYY-MM-DD'),'MMM YYYY')

hope that helps

Joe

Highlighted
Creator II
Creator II

HI

Try this in the List Box by choosing expression and use this

=Date( MonthStart(Trade_date), 'YYYY-MMM')

or as Max dreamer & Balakumar mentioned use MonthName(Trade_date)

Highlighted
Master III
Master III

Add another field in your load script

load

trade_date,

Date(Date#(trade_date, 'YYYY-MM-DD'),'MMM YYYY') as [trade date MMM YYYY],

...

..

from your data source;

hth

Sasi

Highlighted
Creator III
Creator III

Date(Date#(trade_date,'YYYY-MM-DD'),'MMM YYYY')

Highlighted

Hi,

one solution to create both date and month could be:

QlikCommunity_Thread_181791_Pic1.JPG

LOAD *,

        MonthName(trade_date) as trade_month;

LOAD Date#(trade_date,'YYYY-MM-DD') as trade_date

FROM [https://community.qlik.com/thread/181791] (html, codepage is 1252, embedded labels, table is @1);

hope this helps

regards

Marco