Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
chiragngohel
Contributor III
Contributor III

Two tables field value to check

Hi,

Can someone help me please?

I am trying to compare two file fields value with same field name(comparison for two months) in script.

Can some one suggest best way? Is it possible?

FOR i = 1 to NoOfFields('T')
Concatenate

Fields:

LOAD

// FieldName($(i),'New') as FieldName
FieldName($(i),'T') as F,
FieldValue($(i),'T') as v,
//FieldValue(FieldName($(i),'T')) as F2,
//if(FieldName like FieldName($(i),'New') and FieldValue=FieldValue,'Match','Others') as t2,
if(WildMatch(FieldName($(i),'T'), FieldName($(i),'T2')),'Match','Other') as f1,
if(Match(FieldValue($(i),'T'),FieldValue($(i),'T2')),'Match','Other') as f3

AutoGenerate 1

;
NEXT I

12 Replies
chiragngohel
Contributor III
Contributor III
Author

I tried field value but it is not working.

settu_periasamy
Master III
Master III

Hi,

I think your script seems to be fine for me. May be you can try to change the "Next i" ( In your code shows capital letter "I" - I believe this is not a typo)

FOR i = 1 to NoOfFields('T')
Concatenate

Fields:

LOAD

// FieldName($(i),'New') as FieldName
FieldName($(i),'T') as F,
FieldValue($(i),'T') as v,
//FieldValue(FieldName($(i),'T')) as F2,
//if(FieldName like FieldName($(i),'New') and FieldValue=FieldValue,'Match','Others') as t2,
if(WildMatch(FieldName($(i),'T'), FieldName($(i),'T2')),'Match','Other') as f1,
if(Match(FieldValue($(i),'T'),FieldValue($(i),'T2')),'Match','Other') as f3

AutoGenerate 1;


NEXT i

jagan
Luminary Alumni
Luminary Alumni

Hi,

As suggested by settu_periasamy change NEXT I  to NEXT i.

Qlikview is Case sensitive Capital I and Small i is not the same.

Regards,

jagan.

chiragngohel
Contributor III
Contributor III
Author

I cannot see capital "I" in my script. I am using only "i".

chiragngohel
Contributor III
Contributor III
Author

That is already small i.

settu_periasamy
Master III
Master III

Copy your posted Script (In the first post), then check, it shows capital Letter 'I'.

See this..

Capture.JPG

chiragngohel
Contributor III
Contributor III
Author

not I any more.

chiragngohel
Contributor III
Contributor III
Author

T:
LOAD Name,
total,
'table'
as type
FROM

(
ooxml, embedded labels, table is Sheet1);
//Concatenate(T)


QUALIFY *;
UNQUALIFY Name;
//left join(T)
T2:
LOAD Name,
total,
'table2'
as type
FROM

(
ooxml, embedded labels, table is Sheet1);

//
UNQUALIFY *;

chiragngohel
Contributor III
Contributor III
Author

   

Nametotal
a20
b20
c30
d50