Skip to main content
Announcements
See why Qlik is a Leader in the 2024 Gartner® Magic Quadrant™ for Analytics & BI Platforms. Download Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to Find Matching Numbers between two Columns

Hi,

Please assist i need to match Cell Numbers between two Columns, but the problem is

one column starts with country code 27

e.g

Column A

0738257934

the other one is

Column B

27738257934

how do i match the two in Set Analysis?

Thanks.

13 Replies
morganaaron
Specialist
Specialist

Would it not be easier to simply change one in the script when you're loading it, or do you not want these to be linked fields?

Not applicable
Author

Hi,

Please send me your Method that you Prefer

Regards.

jagan
Luminary Alumni
Luminary Alumni

Hi,

Try like this in script

LOAD

*,

If(ColumnA=Mid(ColumnB, 2), 1 0) AS Flag

FROM DataSource;

Now in frontend you can use like

=Sum({<Flag={1}>} MeasureName)

Hope this helps you.

Regards,

Jagan.

prieper
Master II
Master II

IF(LEFT(TelephoneNumber, 2) = '27', '0' & MID(TelephoneNumber, 3, LEN(TelephoneNumber) - 2, TelephoneNumber)

Peter

morganaaron
Specialist
Specialist

I'd renumber the second field. It depends on where these fields come from, but if you simply wanted to change B on load, you could write:

'0' & Mid(ColumnB, 3) as ColumnA

This would join your tables on this field however. If you don't want that to happen, you can either use Jagan's script below, or you can load as ColumnB and use an applicable statement in the frontend.

jagan
Luminary Alumni
Luminary Alumni

HI,

Try this

Hi,

Try like this in script

LOAD

*,

If(Text(ColumnA)= '0' & Mid(ColumnB, 2), 1 0) AS Flag

FROM DataSource;

Now in frontend you can use like

=Sum({<Flag={1}>} MeasureName)

Hope this helps you.

Regards,

Jagan.

buzzy996
Master II
Master II

use this,

=If(ColumnA='0'& right(ColumnB,9),'Matched','UnMatched')

Not applicable
Author

Hi, where will apply this to?

Expression or Load Script?

Not applicable
Author

Isn't possible to apply it on the Front End, set analysis?