
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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')
- Tags:
- dates
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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')

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
HI
Try this if(istext('1990-10-30 9:20'),'string','Date')
Regards
Harsha

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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')

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
if $(Field)='Pavan' then this will go wrong.........
