Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
debmsarkar123
Contributor III
Contributor III

Week Function not working on Date

I have an excel file whose crosstable Im loading and converting the date to week but its coming blank. A snippet of the header I have pasted.  The DT field in cross table starts from column D in the excel.

The code Im using:

Temp:

CrossTable(DT, Forecast, 3)
LOAD * FROM
[Z:\QlikView Documents\upload\xyz.xlsx]
(ooxml, embedded labels, table is Sheet1);

 


Data:

load*,
Week(DT,'DD/MM/YYYY') as WK


Resident Temp;

drop table Temp;

 

debmsarkar123_0-1644606354193.png

I also tried converting DT column to Date data type by passing it through Date() function but then also conversion isnt happening and its returning blank column.

Labels (4)
1 Reply
albertovarela
Partner - Specialist
Partner - Specialist

It seems your date is loaded as text so you need to convert it to date first, then wrap around the week function. Try:  Week(Date#(DT,'DD/MM/YYYY')) as WK