Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to compare two columns in two tables

Guys,

I have two tables as shown below,

Screenshot_1.pngScreenshot_2.png

I need to compare these two tables and to create flag. If the SheetDate in the second table and Date in the first table is matched, then Flag=1 otherwise Flag=0. I want exactly as in the below image,

Screenshot_3.png

Plz help me to achieve this friends.

4 Replies
PrashantSangle

where you want to achieve

In front end or back end

in front end

take straight table

dimension

EmpId

date

sheetdate

Expression

if(date=sheetdate,'1')

In back end

Temp:

Load EmpId,date from table1;

join

Load EmpId,SheetDate from table2;

noconcatenate

Final:

Load *,if(date=sheetdate,'1') as flag Resident Temp;

Regards,

Prashant

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Sergey_Shuklin
Specialist
Specialist

Hello, Siva!

Use left join:

Table 1

EmpID,

Date

left join

Table 2

EmpID,

SheetDate as Date,

SheetDate,

1 as Flag

And you will get what you want (except of 0 values - it will be null)

prma7799
Master III
Master III

PLEASE TRY THIS

Anonymous
Not applicable
Author

hi guys,

If I check this with some sample data, its working. But as per my original data it is not working.

I have attached my data along with this...

Please anybody help in this....