Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Not applicable

Fetch Day from date

Hi Everyone,

i have a field 'Date' having value '16-JUN-2014'

i want only day from the date field i.e 16

tried day(date) it didnt worked

any suggestions are highly appreciated.

Regards

Tausif Khan.

1 Solution

Accepted Solutions

Re: Fetch Day from date

What about LEFT(Date,2)

5 Replies

Re: Fetch Day from date

What about LEFT(Date,2)

Re: Fetch Day from date

Hi,

It seems your date is not in date format then first convert it into date format

Load

Day(Date(Date,'DD-MMM-YYYY')) as DDMMMYYYY_Day

From Source;

Or

Date(Left(Date,2),'DD')

Regards

Anand

Re: Fetch Day from date

Day(Date#(Date, 'DD-MMM-YYYY'))

Re: Fetch Day from date

Hi,

You can achieve it various way

1) using date#()

day(date#(Date,'DD-MMM-YYYY')) as day

or

day(date(date#(Date,'DD-MMM-YYYY'))) as day

or

date(date#(Date,'DD-MMM-YYYY'),'DD') as day

2) using subfield()

subfield(date,'-',1) as day

Regards

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

Re: Fetch Day from date

it seems your using a string, not a date,

try subfield(Date,'-',1)

Community Browser