Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Map in two places????

I have one table with two columns; UserName and SessionStartedDate. I need to add a 3rd column to this table which is called 'Was an active primay user on this date' and populate the it with YES or NO.

The data for this third column comes from a second table with two columns; UserName and 'Date of snapshot'

The slight issue I have is that the snapshot data in the 2nd table is taken on a weekly basis. So what i need to do is insert YES in the 'Was an active primay user on this date' column if the UserName matches and if the 'Date of snapshot' is in the same week as the SessionStartedDate. If there is no match, insert NO instead.

I have attached some sample data, with the two tables on separate tabs.

3 Replies
datanibbler
Champion
Champion

Hi,

if I understand you correctly, you just want to check whether any username in your weekly_snapshot_table is in that two-column mapping table you have?

If that's correct, you can easily do that in a LOAD statement using a WHERE EXISTS() clause.

HTH

Best regards,

DataNibbler

Not applicable
Author

It's not quite that simple. In the weekly snapshot table, the list of usernames varys from week to week.

Therefore the two dates must ALSO be in the same week for the value to appear as YES

Not applicable
Author

Hi Alex, Please give clarify on the below items:

1. The second table ( UserName & DateOfSnapShot) having more than one DateofSnapshot value for each User? In this case you need to verify the SessionStartedDate against all the dates or take the latest DateofSnapshot for verification ?

2. Do you need check Weekstart of the SessionStartedDate against DateofSnapshot ?