Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
paulinhok14
Creator
Creator

Disconsider a record after a character

Community good morning,

In my QlikView document, I read some task records, like this:

Task
71-05-21
23-67-92
01-83-84 (Not found)
21-04-57
43-10-21 (Agreed)

I would like to remove all the part that comes after the "(" in all registers, but keeping the task number...

Is this possible in a "WHERE" clause?

I tried to make something like: = if ( wildmatch ( [Task] , '*(*' ) = 1, Replace ( [Task],  '(*)' , '' ), [Task] ) as New_Field

but without sucess.

Best regards.

1 Solution

Accepted Solutions
sunny_talwar

Try this

Table:

LOAD *,

Trim(Left(Task, Index(Task & '(', '(')-1)) as TaskNum;

LOAD * INLINE [

    Task

    71-05-21

    23-67-92

    01-83-84 (Not found)

    21-04-57

    43-10-21 (Agreed)

];

View solution in original post

6 Replies
sunny_talwar

Try this

Table:

LOAD *,

Trim(Left(Task, Index(Task & '(', '(')-1)) as TaskNum;

LOAD * INLINE [

    Task

    71-05-21

    23-67-92

    01-83-84 (Not found)

    21-04-57

    43-10-21 (Agreed)

];

sasiparupudi1
Master III
Master III

Use Subfield

LOAD *,

SubField(Task,'(',1) as TaskNum;

LOAD * INLINE [

    Task

    71-05-21

    23-67-92

    01-83-84 (Not found)

    21-04-57

    43-10-21 (Agreed)

];

awhitfield
Partner - Champion
Partner - Champion

Hi Paolo,

You could try something like this in your load script:

task:

LOAD

Text(keepChar (Task, '0123456789-')) as Task

FROM

KeepChars.txt

(txt, codepage is 1252, embedded labels, delimiter is '\t', msq);

Where Keepchars.txt just contains your sample data

Best regards

Andy

paulinhok14
Creator
Creator
Author

Amazing man, it worked perfectly!!

Thank you so much

paulinhok14
Creator
Creator
Author

Hello Sasidhar, it worked with Sunny's suggestion, but thank you anyway for your attention!

Best regards!

paulinhok14
Creator
Creator
Author

Hello Andy, it worked with Sunny's suggestion, but thank you anyway for your attention!

Best regards!