Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
paul_scotchford
Specialist
Specialist

Strange data formatting behaviour

Using the following formatting option in the Date() function , the Full Day is truncated and part of the year number is appended ...

Function ... Date("Date", 'WWWW') as FullDayName

Data ...   30Jun2015 = Tuesday015 ,  1Jul2015 = Wednesda15 , 4Jul2015 = Saturda15

Days of Sunday, Monday, Thursday, Friday are returned as expected.

Has this been noticed anywhere by anyone? Normally I don't generate the days this way, we load directly from a

SQL date dimension which has full days predefined.

Thanks

Paul

12 Replies
sunny_talwar

Give this a shot:

=Date(Date#(DateField, 'DMMMYYYY'), 'WWWW')


=Date(Date#(DateField, 'DDMMMYYYY'), 'WWWW')

paul_scotchford
Specialist
Specialist
Author

Hi Sunny

This does not work in my script, returns NULL

Thanks

sunny_talwar

You date field looks like this -> 30Jun2015 (DDMMMYYYY)? or does it follow another format??

paul_scotchford
Specialist
Specialist
Author

Correct this is our format. I think this is a bug perhaps.

The reason I have not noticed this before is that we generate our calendars in SQLServer and

load up a QVD which has days in it.

Just happened across this issue by chance.

sunny_talwar

QlikView seemed to have handled it, let me test it on Qlik Sense.

paul_scotchford
Specialist
Specialist
Author

Ok thanks

sunny_talwar

So this seems to work in QlikView:

=Date(Date#(DateField, 'DDMMMYYYY'), 'WWWW')

but showing just Wednesda (without y for 1Jul2015).

Checking it further on Qlik Sense

paul_scotchford
Specialist
Specialist
Author

Would you say that is working dropping the 'y' is a failure in the function to return the expected value.

sunny_talwar

Ya I would expect to see the whole Wednesday. In Qlik Sense, it isn't doing that, so to me it seems like a bug.

But in QlikView it is showing perfectly (Wednesday)