Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
niha
Creator II
Creator II

Date format

Hello,

Here is my code.

Date([ServiceReceivedDate]) as [Date of First Service],
Year([ServiceReceivedDate]) as FSYear,
Month([ServiceReceivedDate]) as FSMonth,
num(Month([ServiceReceivedDate])) as FSMonthabbr,
Day([ServiceReceivedDate]) as FSDay,
Year([ServiceReceivedDate]) & (Month([ServiceReceivedDate])) as FSYearmonth,

Year([ServiceReceivedDate]) &num (Month([ServiceReceivedDate])) as SYearmonth;

My output is like below:

I want to see SYearmonth like 201601, 201602,201603...so on now it is like 20161, 20162.....like on.

Please advice 

Untitled.pngRegards,

Niha

2 Replies
albertovarela
Partner - Specialist
Partner - Specialist

Add the num format to this line:

 

Year([ServiceReceivedDate]) &num (Month([ServiceReceivedDate]),'00') as SYearmonth

rogerpegler
Creator II
Creator II

Or another way:

Date([ServiceReceivedDate],'YYYYMM') as [Date of First Service],