Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

businessintelli
New Contributor III

Matching values

Hello,

I have one question. I have 12 digit numbers. I want to create a new field for the numbers who have  more than 8 digits the same. Is this possible in qlik sense?

13 Replies
wdchristensen
Contributor III

Re: Matching values

Can you provide a little more detail (an example would help)? Are you trying to join two table on a "LIKE" condition?

sql

Select *

from tbl_1, tbl_2

where tbl_1.digit like '%' & tbl_2.digit & '%'

OR charindex(tbl_2.digit, tbl_1.digit) >= 1

businessintelli
New Contributor III

Re: Matching values

I have one table and in this table I have a column ID. IDs are 12 digit numbers.

For example:

125169875265

124167875265

125164875465

125452752645

I want to create another field. I want to look up the IDs where  more than 8 digits are same( in all of these ID's)  .

if (more than 8 digits are same, 'something','other') --- I want something like this

Is it clear ?

OmarBenSalem
Esteemed Contributor

Re: Matching values

if(len(trim(YourField))>=8,'Sthing','other')

wdchristensen
Contributor III

Re: Matching values

if(FindOneOf(sourceString, findString, 1) >= 1, 'something','other')

zebhashmi
Valued Contributor

Re: Matching values

No - what is required output from the data 

businessintelli
New Contributor III

Re: Matching values

In sourceString I write the IDs and what should I write in find string?? numbers ? ( but I want any number which has more than 8 digit the same) . Or should I write 8 ?

Sorry for these questions but i didn't understand this formula well. what does >=1 means in this formula ?

zebhashmi
Valued Contributor

Re: Matching values

so they all are 8 digits long but non of them are same

yes?

businessintelli
New Contributor III

Re: Matching values

For example,

I have these 2 IDs

145687432146 

145647432146 

Second ID has 11 same digits.There is only one different digit so I want to have description as 'something'

else 'other'

Community Browser