Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Loeckli
Contributor III
Contributor III

Cant not change datatype

I'm trying to change datatype, the data gets loaded over 

SQL Select 

The datatype after the loading is $numeric 2023-08-31 12:46:01.000000, my desired datatype is a date format. 

 I tried different kind of approaches in the front end:

Date(num([My value], 'YYYY-dd-MM hh:mm:ss'), 'dd.MM.YYYY') as t1

(Timestamp#([My Value],'YYYY-dd-MM hh:mm:ss TT '),'dd.MM.YYYY') as t1 

but nothing is working the data type only gets changed to $integer or to text ascii. Does anyone have an idea what I'm missing ?

Labels (5)
10 Replies
akmalquamri
Contributor III
Contributor III

Try this: Date(Date#(column_name, 'date_format'), 'your_required_format')
Loeckli
Contributor III
Contributor III
Author

Thanks for the repley if i use this line of code the data type is $text $ascii-...

how does that happen ?

akmalquamri
Contributor III
Contributor III

Which mean this is date type you can validate it in frontend with table try to use month, year functions to double check whethe it is working or not.

 

Date# and Date are two different functions. Date# tells the systen that perticular column is date. And Date functions helps you to change the date format.

kkarlste
Creator
Creator

This has already been set in the database for one year. Now I just need the right script to get years greater than 2018 in the selection box

Loeckli
Contributor III
Contributor III
Author

Yes i know but how can i be that after date and date# the data type is not as it should be...
the month function works on the output of Date(Date#(column_name, 'date_format'), 'your_required_format')

but i get the names in text like dec. 

akmalquamri
Contributor III
Contributor III

1. Qlik needs to identify, most of the time they don't recognize the date datatypes. Best practices we do date# function.

2. Try doing this by set analysis keep year >= "2018" [Note: this will not effect the value while using filter pane].

marcus_sommer

It is a dual() value - means a return-value of dec is just the string-representation of the real numeric value of 12. If you want to have also 12 as string-representation you could apply num(month(Field)).

Loeckli
Contributor III
Contributor III
Author

that makes absolutly sense, but my goal is just to change the data type completly to $numeric $timestamp. How would i achieve that ?

akmalquamri
Contributor III
Contributor III

Do try this - Date(Date#(Year(DateColumn), 'DD/MM/YYYY'), 'MM/DD/YYYY') as datecolumn