One Star

[resolved] in tMap compare 2 strings which come from 2 files

Hi everybody,
in my tMap i have 2 files (input), in each file there is 2 column "Name" and "status" in the column name there are different name and in the column status there is "active" or "inactive". The first file is about last month (April) and the second is about this month (may).
i want to compare the name which were "active" last month to the name which are "inactive" this month and when there is someone who were "active" then "inactive" i want to put his name out
I try with this expression:"row1.User_Status.contains("Active") &&  row2.User_Status.contains("InActive") ?true : false"
but it doesn't work.
can you help me??
1 ACCEPTED SOLUTION

Accepted Solutions
One Star

Re: [resolved] in tMap compare 2 strings which come from 2 files

this is tMap parameter and the fonction i use in VAR
 
9 REPLIES
One Star

Re: [resolved] in tMap compare 2 strings which come from 2 files

Hi, Whats the problem with the output you are getting with this?
Can you paste the sample output you are getting?
Join between the two files are all properly made?
One Star

Re: [resolved] in tMap compare 2 strings which come from 2 files

when i open the exel file (output) there are name which were inactive (april) and inactive now (may) 

Re: [resolved] in tMap compare 2 strings which come from 2 files

It will be very helpful if you can post some screenshots of your job and some example data. With some more information Im sure we can assist you. 
Highlighted
One Star

Re: [resolved] in tMap compare 2 strings which come from 2 files

this is my job
One Star

Re: [resolved] in tMap compare 2 strings which come from 2 files

this is tMap parameter and the fonction i use in VAR
 
One Star

Re: [resolved] in tMap compare 2 strings which come from 2 files

this is my Excel output (i take of all the column by my self) if my job works i should got only 6 lines and i check in my files and all the the lines i got in my excel file output corespond to name wich are inactive in april and inactive in may
One Star

Re: [resolved] in tMap compare 2 strings which come from 2 files

@Mallee:
You'd have been getting organisation names which were having Inactive status in April and May because you are using "contains" in your expression editor. It should have been "equals".
your expression should read as below:
"row1.User_Status.equals("Active") &&  row2.User_Status.equals("InActive") ?true : false"

Also i have got couple of questions in your job design
1.Why you are using User_Status as key for joining row1 and row2. Is Organisation_name not enough for keying purpose?
2.Are you using inner join between row1 and row2?
Let me know if you are still hit with problems.
One Star

Re: [resolved] in tMap compare 2 strings which come from 2 files

hi, your right i don't need to use user_status as a key join and no i'm not using inner join !
but it still not working
I try to use the expression with equals instead of contains but when i do this and i run my job, my excel file output is empty
One Star

Re: [resolved] in tMap compare 2 strings which come from 2 files

Thanks for your answer !
i find my mystake i just invert may and april 
and i use equal in my expression
thanks
Mallee