Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Date Conversion

Hi Guys,

I have a requirement to convert the excel into straight table. I am able to do that but there is a field which is a date field and when it's pulled in to application, it gets converted to number and despite of many trials I am not able to get the date from it. Please find attached the excel and my QVW in progress.

Basically, in qlikview I need the follwoing result

Field1Field2MonthYearData
ab11 March 201423
ab11 December 201445
cd11 March 201467
cd11 December 201489
1 Solution

Accepted Solutions
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

Try this.

Load Mnth as MonthName, Date(Num#(Mnth),'DD MMM YYYY') as MMMM Resident 1;

Its because the number which you are loading is in Text format.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!

View solution in original post

5 Replies
beck_bakytbek
Master
Master

hi neha,

try to use the year(), month() in script,

beck

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

Try this.

Load Mnth as MonthName, Date(Num#(Mnth),'DD MMM YYYY') as MMMM Resident 1;

Its because the number which you are loading is in Text format.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
sunny_talwar

Try adding Num#() to your resident load:

1:

CrossTable(Mnth, Data, 2)

LOAD * FROM

Date.xlsx

(ooxml, embedded labels, table is Sheet1);

LOAD Mnth as MonthName,

  Date(Num#(Mnth),'DD MMM YYYY') as MMMM

Resident 1;


Capture.PNG

Anonymous
Not applicable
Author

Thanks for the immediate response guys, it helped!

Num# is something I was missing there.

Thanks,

Neha

rik_qlik
Contributor III
Contributor III

Hi neha sharma,

As Kaushik Solanki highlight, it seems the crosstable(..) function doesn't keep the original date format from excel during the table transformation..

In fact you can see the field 'Mnth' is on the left side of your list box, because it's interpret as a text field after the transformation of the function crosstable(..).

So you must use the 'Num#(Mnth)' function in the script to pass to Qlik the right format information.

So if you use the 'Date(Num#(Mnth),'DD MMM YYYY') as MMMM' and you put the 'MMMM' field in a list box you can see what you want achieve.

Regards,

Riccardo C.