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.
paulyeo11
Valued Contributor II

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

Re: How to convert my date field to Dual ?

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
Valued Contributor II

Re: How to convert my date field to Dual ?

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
Valued Contributor II

Re: How to convert my date field to Dual ?

Hi Satish

I am using QS. it does not allow change.

Paul

paulyeo11
Valued Contributor II

Re: How to convert my date field to Dual ?

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
Valued Contributor II

Re: How to convert my date field to Dual ?

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

Re: How to convert my date field to Dual ?

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

paulyeo11
Valued Contributor II

Re: How to convert my date field to Dual ?

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
Honored Contributor III

Re: How to convert my date field to Dual ?

Please post sample data..

paulyeo11
Valued Contributor II

Re: How to convert my date field to Dual ?

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

Community Browser