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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Brackets within a load script

Hello,

I have a record that looks like this:

LOAD * INLINE [

A, B, C

b, m, a;b;c;e;f;g;h;i;j;k;l;m;n

]

;

What I would like to obtain is the following:

A, B, C

b, m, b;c;d;e;f;g;h;i;j;k;l;m

I have expanded the record using SubField(C, ';') and flagged the b and m records and removed the "noise" values (a and n)

Is there a more elegant way to do this? since I have a lot of records.

Thanks,


Antoine

1 Solution

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

One approach would be:

LOAD

  A,

  B,

  A & TextBetween(C,A,B) & B as C

INLINE [

A, B, C

b, m, a;b;c;e;f;g;h;i;j;k;l;m;n

];

-Rob

http://masterssummit.com

http://robwunderlich.com

View solution in original post

3 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

One approach would be:

LOAD

  A,

  B,

  A & TextBetween(C,A,B) & B as C

INLINE [

A, B, C

b, m, a;b;c;e;f;g;h;i;j;k;l;m;n

];

-Rob

http://masterssummit.com

http://robwunderlich.com

swuehl
MVP
MVP

Sorry, I don't really understand what you are trying to do, or better said, what the requirement is and which logic should be applied.

Using subfield() may be a reasonable way to do what you want, but without knowing what you need, it's hard to say.

Why don't you just post your current script and explain a bit more what you need to do in a more abstract way (how do you determine the noise values, for example? What are fields A, B for? do you need to concatenate the C values again after removing the noise?).

So maybe someone can suggest a more 'elegant' way or at least some alternative implementation.

Anonymous
Not applicable
Author

Sorry Stefan if I was unclear.

I will still use subfield at a later step.

I needed to reduce information noise, meaning the values a and n that do not belong to the values between b and m.

I didn't want to post the entire code because I would have to place lots of code and people might not have the patience to read several lines of script. Hence the simplification.

Ultimately
What I am trying to do is create a bracket to perform interval matching.

Thanks for both of you

Antoine