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

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

[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??
Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

this is tMap parameter and the fonction i use in VAR
0683p000009MDgv.png 0683p000009ME9X.png 0683p000009ME9c.png  

View solution in original post

9 Replies
Anonymous
Not applicable
Author

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?
Anonymous
Not applicable
Author

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

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. 
Anonymous
Not applicable
Author

this is my job
0683p000009MDyQ.png
Anonymous
Not applicable
Author

this is tMap parameter and the fonction i use in VAR
0683p000009MDgv.png 0683p000009ME9X.png 0683p000009ME9c.png  
Anonymous
Not applicable
Author

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
0683p000009ME9h.png
Anonymous
Not applicable
Author

@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.
Anonymous
Not applicable
Author

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
Anonymous
Not applicable
Author

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