Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
d_koti24
Creator II
Creator II

Regarding date format?

Hi All,

I have two fields like month,and year

MonthYear
32015
42015
52015
62015
72015

i want to display monthyear in List box

like Monthyear:2015-03,2015-04,-----2015-07

How to achive this?

regards,

kd

6 Replies
marcus_malinow
Partner - Specialist III
Partner - Specialist III

You can either modify your load script to assemble the field as

Year & '-' & Num(Month,'00')

Or use this as a calculated dimension

settu_periasamy
Master III
Master III

Hi,

Add the Field in Script like below.

Load *,Date(Date,'YYYY-MM') as YearMonth;

Load *,MakeDate(Year,Month) as Date;

LOAD * INLINE [

    Month, Year

    3, 2015

    4, 2015

    5, 2015

    6, 2015

    7, 2015

    

];

rubenmarin

If you want it in date DataType, so you can use date functions if needed:

Date(MakeDate(Year, Month), 'YYYY-MM')

jagan
Luminary Alumni
Luminary Alumni

Hi Koti,

Try like this

LOAD

Month,

Year,

Date(MakeDate(Year, Month), 'YYYY-MM') AS MonthYear

FROM DataSource;

Hope this helps you.

Regards,

Jagan.

Gabriel
Partner - Specialist III
Partner - Specialist III

Hi,

Try this

Temp_Data:

LOAD * INLINE [

    Month, Year

    3, 2015

    4, 2015

    5, 2015

    6, 2015

    7, 2015

];

Final:

LOAD

*,

Date(MakeDate(Year, Month),'YYYY-MM')                AS [Yr Mnth]

Resident Temp_Data

Order By Year, Month DESC

;

DROP Table Temp_Data;

MarcoWedel

Hi,

if you don't want to change your script, you could use a calculated list box with the already proposed expressions.

Some solutions could be:

QlikCommunity_Thread_188751_Pic1.JPG

QlikCommunity_Thread_188751_Pic2.JPG

QlikCommunity_Thread_188751_Pic3.JPG

hope this helps

regards

Marco