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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
b_garside
Partner - Specialist
Partner - Specialist

Easy way to check if a field is a Date or String...?

Is there an easy way to check if a field is a Date field or Not...?

I know Qlikview only knows them data types as Integers or strings, but I wanted to do this for some custom filtering logic I have.

Any ideas welcomed. I thought if I could use the $Date tag would make it easy or I may have to detect it by field name.

I'm using an If statement currently in this simplified statement.

If( $Field Like '*date*' , 'Date', 'String')

1 Solution

Accepted Solutions
b_garside
Partner - Specialist
Partner - Specialist
Author

The other way is to measure len of data field.

Dates are 5 digits long this works fairly well.

If( Len(Num($Field))=5 , 'Date', 'String')

View solution in original post

3 Replies
Anonymous
Not applicable

HI

Try this if(istext('1990-10-30 9:20'),'string','Date')

Regards

Harsha

b_garside
Partner - Specialist
Partner - Specialist
Author

The other way is to measure len of data field.

Dates are 5 digits long this works fairly well.

If( Len(Num($Field))=5 , 'Date', 'String')

Anonymous
Not applicable

if $(Field)='Pavan' then this will go wrong.........