Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
thabo2g5
Contributor III
Contributor III

how to use subfield()

i have date data that is combined with time so i just need help to separate the data into two different columns , i'm still new in qlikview

5 Replies
shraddha_g
Partner - Master III
Partner - Master III

Can you provide sample data with expected output.?

Anonymous
Not applicable

do you  mean   , you would like to separate  Date and time    for a cilumn like 10/26/2016 12:01 PM ?

thabo2g5
Contributor III
Contributor III
Author

these  10/26/2016 12:01 PM are int the same  column  i want to  separate them  so that  the date  has its own table so as time

Anonymous
Not applicable

if  0/26/2016 12:01 PM is in  "Datefield"


Date#(SubField(Datefield, ' ', 1),'MM/DD/YYYY') as  Date............

time#(SubField(Dateield, ' ', -1),'HH:MM:SS')  as Time ........  

maxgro
MVP
MVP

you can use the floor (for date) and the frac (for time) functions

load

  *,

  Date(Floor(Timestamp#(datetime, 'MM/DD/YYYY hh:mm tt'))) as date,

  Time(Frac(Timestamp#(datetime, 'MM/DD/YYYY hh:mm tt'))) as time

inline [

datetime

10/26/2016 12:01 PM

];