Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
paulyeo11
Master
Master

How to convert my date field to Dual ?

Hi All

I have below script :-

Date(Monthstart([TempDate]), 'DD-MMM-YY')

as YearMonthDay,

I get number instead of date . So i think if i change the above script to Dual , it should help.

Paul

17 Replies
sunny_talwar

Date function is dual in nature. If you are using Date function, I don't see why you are not seeing Date (and seeing Numbers)

satishkurra
Specialist II
Specialist II

Get the YearMonthDay on to the presentation layer, right click go to number tab and check docuemnt overide settings and select date and specify the desired format.

Thanks

paulyeo11
Master
Master
Author

Hi Satish

I am using QS. it does not allow change.

Paul

paulyeo11
Master
Master
Author

Hi Sunny

Below script i also encounter the same problem , in QS it display number.

Date(Monthstart([TempDate]), 'YY MMM') as YearMonth,

After i change to below :-

Dual(Date(Monthstart([TempDate]), 'YY MMM'), MonthStart(TempDate)) as YearMonth,

it work fine in QS.

Paul

satishkurra
Specialist II
Specialist II

Ok sorry as the discussion is posted in Qlikview

For Qliksense

Go back to script window and use Date conversion function as

Date(Date#(TransDate,'M/D/YYYY')) as TransDate

You should get now

Thanks

sunny_talwar

That is very strange and seems like a bug to me.

paulyeo11
Master
Master
Author

Hi Satish ,

I have try your proposal , it still the same , it return number.

All below work fine in QS :-

Dual(Date(Monthstart([TempDate]), 'YY MMM'), MonthStart(TempDate)) as YearMonth,

Dual('W ' & text(1+ceil((TempDate-floor(weekend(monthstart(TempDate))))/7)) & text(date(TempDate,' MMM YY')),weekstart(TempDate)) as YearMonthWeek,

Right(year(TempDate),2)  as YEAR_,

year(TempDate) as [Year],

Y AS year,

But below not working , as return number :-

Date(Monthstart([TempDate]), 'DD-MMM-YY') as YearMonthDay,  // return number

Date(Date#([TempDate],'M/D/YYYY')) as YearMonthDay,  // return number

My conclusion is if can make above script starting with Dual or Text or Right it should be okay.

Paul

sasiparupudi1
Master III
Master III

Please post sample data..

paulyeo11
Master
Master
Author

Hi Sasi

Thank you for interested to look into my case, enclosed pls find QV chart is okay , but when use in QS is not okay