Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
EugeniaCastilla
Contributor
Contributor

Date() function working as a measure but not in script

I have the following line of code:

[Data]:
LOAD
[ID_Factura],
[Date],
Date(Date#([Date],'M/D/YYYY'),'DD/MM/YYYY') as miDate,
[Market],
[Product],
[Units],
[Sales]
FROM [lib://AttachedFiles/Data Workshop.xlsx]
(ooxml, embedded labels, table is Data);

 

miDate appears as null when I load the script. However when I write the same exact format line in any visualization, it works fine:

EugeniaCastilla_0-1658681266039.png

Why might this be happening? I have deleted all the time Formats and everything just in case it was that and nothing ... please help

Labels (1)
1 Solution

Accepted Solutions
Thiago_Justen_

Try this Just to figure out what is happening:

Alt(

Date(Date([Date],'MM/DD/YYYY'),'DD/MM/YYYY'),

Date([Date])

)    as miDate,

By seeing your table I guess the date field is already in date format.

 

Cheers

Thiago Justen Teixeira Gonçalves
Farol BI
WhatsApp: 24 98152-1675
Skype: justen.thiago

View solution in original post

2 Replies
Thiago_Justen_

Try this Just to figure out what is happening:

Alt(

Date(Date([Date],'MM/DD/YYYY'),'DD/MM/YYYY'),

Date([Date])

)    as miDate,

By seeing your table I guess the date field is already in date format.

 

Cheers

Thiago Justen Teixeira Gonçalves
Farol BI
WhatsApp: 24 98152-1675
Skype: justen.thiago
EugeniaCastilla
Contributor
Contributor
Author

Your formula worked ... 

EugeniaCastilla_0-1658732692557.png

 

Please please! Explain why becasue I am not understanding anything. Up to this point my approach has always worked.... I don0t understand why it doesn't on the script but yes in visualizations..