Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
fmazzarelli
Partner - Creator III
Partner - Creator III

STRING 254 01:58

Hi Community,

i have this values

NUMBER

250 07:03

670 09:30

28 15:01

if i use

left(NUMBER,3)

mid(NUMBER, 5,2)

result is

left

250

670

28

mid

07

09

5 (error)

How could I extract the 3 (left) characters having a dynamic field ?

5 Replies
Anonymous
Not applicable

Maybe something like :

     SubField('28 15:01',' ',1)

and

   SubField(subfield('28 15:01',' ',2),':')

Not applicable

There are different Ways

You can split the String (may on blank or colon) as Bill Markham has recommeded to you

you can also use right instead of the left statement, if you want to select the time

fmazzarelli
Partner - Creator III
Partner - Creator III
Author

hi,

not all time but only hh (15)

28 15:01

I need to calculate how many hours are 28 days + 15 hours

The final result should be 28*24 + 15 = 687

Not applicable

Bill Markham's way will work

num(SubField($(TextVar),' ',1))*24 + num(SubField(SubField($(TextVar)' ',2),':',1))

nicolas66
Contributor III
Contributor III

Bonjour,

maybe:

left(right(NUMBER,5),2) AS hour