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

Remove from field

Hi.


I am loading data from a table and would like to remove the last ten characters (YYYY-MM-DD) from the field 'Bevakning'. The total length of the string can vary and it can consist of text, numbers or both, separated by blanks, but the last ten characters are always a date formatet as YYYY-MM-DD.

BEVAKNING

123 2017-03-01

Ändra förväntat belopp 2017-02-27

I want it like

BEVAKNING

123

Ändra förväntat belopp

Anyone who can help me solve this one?

Thank you!

Anna

1 Solution

Accepted Solutions
aarkay29
Specialist
Specialist

Left(Field,Len(Field)-10)

View solution in original post

7 Replies
adamdavi3s
Master
Master

something like:

mid(field,1,len(field)-10)

aarkay29
Specialist
Specialist

Left(Field,Len(Field)-10)

adamdavi3s
Master
Master

yeah I have no idea why I chose mid over left

albertovarela
Partner - Specialist
Partner - Specialist

Left(Field,Len(Field)-11)  // 10 positions to get rid of date + 1 for the leading space

aarkay29
Specialist
Specialist

check this

annanirvin
Contributor III
Contributor III
Author

Tried again and it worked. Thanks a lot!

MarcoWedel

maybe using

Trim(Left(BEVAKNING,Len(BEVAKNING)-10)) as BEVAKNING

to get rid of possible trailing spaces ...

hope this helps

regards

Marco