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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Comparing string parts - PEEK/PREVIOUS functions

Greetings everyone!

I have the a problem scenario at hands, and I can't put it together as a solution using AQL...

Here it is:

I must read a string part from a field , store it in a variable (or something), and then compare it with other records of the same field, over and over in a loop (FOR... or WHILE... statements), till the end of the table.

I tried using PEEK and PREVIOUS functions together to perform it, but unsuccesfully.

Any ideas how this can be done?

In advance, I'm sorry if the explanation is kinda messy, but I can't find a better way to put it down in this first moment.

Thanx again!!!

Labels (1)
4 Replies
Not applicable
Author

Anybody???

=S

hector
Specialist
Specialist

Hi

i'm not following, do you have an example of the input data and the expected result??

Rgds

Not applicable
Author

I want to verify if a portion of a string matches total or partialy the subsequent string to be compared...

Like

CUSTOMER_NAME
________________

Sadia SA
Sadia S.A
Sadia S/A
Sadia S A

.
.
.

Observing the composition of the strings, they are different matches. But for the business, they are all the same (once I have no access to the source of the information, to treat them all in order to have no such results).

My idea: Read 6 or 8 characters of each string, compare it with all the other records of the same field, in order to retrieve all relevant data.

I first thought about creating a variable that would store the string to be found in the search, but i could not do that...

My nearest strike was that expression:

Table1:
LEFT(CUSTOMER_NAME,6) AS CUSTOMER_NAME_VAR1
FROM table1;

Table2:
IF(WILDMATCH(CUSTOMER_NAME,CUSTOMER_NAME_VAR1 & '*' ) = 1, CUSTOMER_NAME) AS CUSTOMER_NAME,
FROM table1;

DROP TABLE table1;

I hope it helps to explain the situation.

THX!!!




hector
Specialist
Specialist

Hi

there is an option change the value of this field? maybe with purgechar() and upper

Ex

upper(Purgechar(field,'./&$'))

so this will return 'SADIA SA' for every row

is this helpful?

Rgds