Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to differentiate data field after linking?

Hi All,

I am having a problem in differentiating the data field after linking. I have a master table which contain information about employees. There are few tables that are attached to this table based on the Employee ID.

Now my problem is I need to draw a chart taking my dimension value from master table and counting EMPLID from a specific table. But all the tables have EMPLID as there linking criteria. How would QV chart differentitate what EMPLID values i need to count, it may be counting total EMPLID from table 1 attached to master table or from table 2 .

I can't use a Qualify statement to differentiate between EMPLID of different tables coz that is my linking field, through which it is linked to master table.

So, what is a way to differentiate from which table we need to count the EMPLID. thanks.

Any help will be appreciated . It's Urgent.

1 Solution

Accepted Solutions
johnw
Champion III
Champion III

Add a separate copy of the EMPLID under a different name to the table you want to count from, and count the copy.  Alternatively, if you just need a count of matching rows on the other table, count any field in that table that is NOT a key field.

View solution in original post

6 Replies
johnw
Champion III
Champion III

Add a separate copy of the EMPLID under a different name to the table you want to count from, and count the copy.  Alternatively, if you just need a count of matching rows on the other table, count any field in that table that is NOT a key field.

Not applicable
Author

Thanks for replying John. So you mean adding a load statement above select and then writing

Load EMPLID as Table1EMPLID;

Will this work?

johnw
Champion III
Champion III

If you're loading the table by just using a select, you'd need to do LOAD *,EMPLID as Table1EMPLID;, but yes.  Then you can just count(Table1EMPLID) or count(distinct Table1EMPLID) depending on what you need.  But you still have the EMPLID field in the table to handle your linkage duties.  Compression should keep the new field from taking much space at all, though I haven't verified that.

Not applicable
Author

I'm sorry John, but I didn't get what you mean by this:

" Compression should keep the new field from taking much space at all, though I haven't verified that."

??

Thanks for replying.

johnw
Champion III
Champion III

If you have 1 billion rows in Table 1, you might think that adding a 10-byte ID would take 10 GB of memory.  However, QlikView compresses your data to take less space.  Two columns with identical values are easily compressed to not much more space than a single column.  Therefore, adding Table1EMPLID should not cause any memory problems, no matter how large Table 1 is.

So the new field will not take much memory.  That's all I was saying.

Not applicable
Author

Ok got it. Thanks a lot John. Appreciate your help.