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

Announcements
Qlik and ServiceNow Partner to Bring Trusted Enterprise Context into AI-Powered Workflows. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
nagasekhar
Contributor III
Contributor III

DIFFERENT DATE FUCTIONS

load
alt(date#(Mydate,'23-10-2018'),date#(Mydate,'20/11/2018'), date#(Mydate,'15-12-2018'),'DD/MM/YYYY') as Mydate;
date:
LOAD * Inline [

Mydate,sales
23-10-2018,100
20/11/2018,200
15-12-2018,300


];

I am getting wrong values

 

Screenshot 2021-10-01 111424.png

 

4 Solutions

Accepted Solutions
tresB
Champion III
Champion III

You have to pass the date formats in date#() instead of the values like:

load

Date(
alt(date#(Mydate,'DD-MM-YYYY'),date#(Mydate,'DD/MM/YYYY'))

,'DD/MM/YYYY')       as Mydate

View solution in original post

AshutoshBhumkar
Partner - Specialist
Partner - Specialist

Hi,

Use below expression :

Date(alt(date#(Mydate,'DD-MM-YYYY'),date#(Mydate,'DD/MM/YYYY'), date#(Mydate,'DD-MM-YYYY')),'DD/MM/YYYY') as Mydate;

 

Thanks,

Ashutosh

View solution in original post

nagasekhar
Contributor III
Contributor III
Author

load
date(alt(date#(Mydate,'23-10-2018'),date#(Mydate,'20/11/2018'), date#(Mydate,'15-12-2018'),'DD/MM/YYYY')) as Mydate;
date:
LOAD * Inline [

Mydate,sales
23-10-2018,100
20/11/2018,200
15-12-2018,300


];

 

but still getting wrong values

 

 

Screenshot 2021-10-01 124540.png

View solution in original post

AshutoshBhumkar
Partner - Specialist
Partner - Specialist

Hi,

You are using manual dates in Date#() function.

You need to use predefined column (Created in Inline table) in Date#() function.

 

Use expression of   or mine to get that correct.

View solution in original post

6 Replies
tresB
Champion III
Champion III

You have to pass the date formats in date#() instead of the values like:

load

Date(
alt(date#(Mydate,'DD-MM-YYYY'),date#(Mydate,'DD/MM/YYYY'))

,'DD/MM/YYYY')       as Mydate

AshutoshBhumkar
Partner - Specialist
Partner - Specialist

Hi,

Use below expression :

Date(alt(date#(Mydate,'DD-MM-YYYY'),date#(Mydate,'DD/MM/YYYY'), date#(Mydate,'DD-MM-YYYY')),'DD/MM/YYYY') as Mydate;

 

Thanks,

Ashutosh

nagasekhar
Contributor III
Contributor III
Author

 

load
date(alt(date#(Mydate,'23-10-2018'),date#(Mydate,'20/11/2018'), date#(Mydate,'15-12-2018'),'DD/MM/YYYY')) as Mydate;
date:
LOAD * Inline [

Mydate,sales
23-10-2018,100
20/11/2018,200
15-12-2018,300


];

still getting wrong values

 

 

nagasekhar_0-1633072638210.png

 

nagasekhar
Contributor III
Contributor III
Author

load
date(alt(date#(Mydate,'23-10-2018'),date#(Mydate,'20/11/2018'), date#(Mydate,'15-12-2018'),'DD/MM/YYYY')) as Mydate;
date:
LOAD * Inline [

Mydate,sales
23-10-2018,100
20/11/2018,200
15-12-2018,300


];

 

but still getting wrong values

 

 

Screenshot 2021-10-01 124540.png

tresB
Champion III
Champion III

@nagasekhar , you are still using wrong expression. 😋  Copy-paste the expression I posted and check.

AshutoshBhumkar
Partner - Specialist
Partner - Specialist

Hi,

You are using manual dates in Date#() function.

You need to use predefined column (Created in Inline table) in Date#() function.

 

Use expression of   or mine to get that correct.