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

Announcements
Learn how to migrate to Qlik Cloud Analytics™: On-Demand Briefing!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Trimming a string containing numbers and text

Hi I have the following data with the current data and expected data. What's the best way to get this output ?

Is it perhaps easier to do this in excel ?

Many thanks

1 Solution

Accepted Solutions
johnw
Champion III
Champion III

Maybe this in Excel?

=TRIM(MID(A2,FIND("-",A2)+2,99))

View solution in original post

10 Replies
swuehl
MVP
MVP

Try something like

LOAD

     Trim(SubField(CURRENT,'-',2)) as EXPECTED

FROM ....;

Not applicable
Author

Thanks Stefan. Any ideas how to do this in excel too ?

johnw
Champion III
Champion III

Maybe this in Excel?

=TRIM(MID(A2,FIND("-",A2)+2,99))

Not applicable
Author

Hi Swuehl,

in extension to this i have one more question

 

CURRENTEXPECTED OUTPUTif I enter these current field values in an input box, I need to show those values in a text box like
1-taxes|2-sales|5-employees|4-taxes|3-sales|6-employees
1 - taxes1-taxes
2 - sales2-sales
5 - employees5-employees
4taxes4-taxes
3sales3-sales
6employees6-employees

How do i achieve it?

maxgro‌; tresesco‌; stalwar1‌; jagan‌; hic

Thank you!

John

tamilarasu
Champion
Champion

You can also try.

=RIGHT(A2, LEN(A2)-FIND("-", A2))

tamilarasu
Champion
Champion

johndawson

Try something like this,

=Replace('$(vVarName)', chr(10),'|')

vVarName -> Variable name which you assigned in Input box.


Hope this helps.

Not applicable
Author

Thanks Tamil Nagaraj for your quick response.

here if you look at my expected out put you need to convert

1 - taxes
2 - sales
5 - employees
4taxes
3sales

6employees

to same format like

1-taxes

2-sales

5-employees

4-taxes

3-sales

6-employees

then your expression will work .

Thank you.

John

tamilarasu
Champion
Champion

Hi John,

Sorry. I have some important work to complete. I'll surely check and update after my work.