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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Issues in the Comparision of two fields ?


Hi All,

I am new to Qlikview.

I have below questions.

Example :

I need to compare two fields - Field A and Field B.

Field A - Data - 0000012345

Field B - Data - 12345

I need to make it field field B in 10 digit formate - i need to append leading zero to make it 10 digit

so, I can compare two fields data.

I have use Num (12345,'0000000000') AS Field B.

when i have Load script output it shows in 10 digit.

But, when I have joins two fields - it does not joins based on data matching between two fields.

so, can you please guide me what would be the issue ?

does is because two fields have different data types ?

what would be data type of Num (12345,'0000000000') ?

any assistance would be greatly appreciated.

Thanks!.

7 Replies
ashfaq_haseeb
Champion III
Champion III

Hi,

may be like this.

Regards

ASHFAQ

Not applicable
Author

can you please suggest me solution of this ?

ashfaq_haseeb
Champion III
Champion III

Hi,

look at my attachment. It has solution in  it.

Regards

ASHFAQ

Not applicable
Author

I am new to qlikview and new to this forum.

can you please guide me and provide me link of that thread or document ?

Appreciate your help.

maxgro
MVP
MVP

try this

or post your qlikview document

// table with 0000012345

table1:

load * inline

[

f1,f2

0000012345,aaaaaaaa

0000067890,cccccccc

];

// table with 12345 with num function to change 12345 in 0000012345

table2:

load

     num(f1, '0000000000') as f1,

     f3;

load * inline

[

f1,f3

12345,bbbbbbbb

67890,cccccccc

];

// join table1 and table2

left join (table1) load * Resident table2;

drop Table table2;

ashfaq_haseeb
Champion III
Champion III

Hi,

go to edit script and write the below code.

table1:

load * Inline [

KEY,CODE

ABC,AB

DEF,DE

XYZ,XY

YYY,YY];

table2:

Join load * Inline [

KEY,FIELD1

ABC,G-H-G-H-G-A-B-AB-ABC

DEF,AB-AB-DE-EF

XYZ,ABC-XY-QYZ

YYY,TT];

tabfinal:

NoConcatenate load KEY,CODE,FIELD1, if(SubStringCount(FIELD1,CODE)>0,'PRESENT','ABSENT') as CODEFLAG Resident table1;

DROP Table table1;

Regards

ASHFAQ

preminqlik
Specialist II
Specialist II

table1:

Load *,

AutoNumberHash128(FieldA)          as               Key

from path;

join

//table 2:

load *,

autonumberhash128(fieldB)               as          Key

from path;