Qlik Community

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Customer & Partners, DEC. 9, 11 AM ET: Qlik Product & Strategy Roadmap Session: Data Analytics REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Qlikuser201
Creator
Creator

Associate the table using new key

joining the tables using newly assigned keys
 

I have two sample tables like below

Table 1:

company codeFieldsKey1
AAManagement total1
AAstaff total2
ABManagement total1
ABstaff total

2

 

 

Table 2:

Company codeAttributed fieldskey 2
AAManager1
AACIO1
AAIT Staff2
AADev Staff2
ABManager1
ABCIO1
ABIT Staff2
ABDev Staff2

 

these tables are already joined by the primary Key company code, now I want to associate them based on Key 1 and Key 2

1 Solution

Accepted Solutions
abhijitnalekar
Specialist
Specialist

Can you send the screenshot of the script. The same QVF is working properly.

Regards,
Abhijit
keep Qliking...

View solution in original post

5 Replies
abhijitnalekar
Specialist
Specialist

HI @Qlikuser201 ,

Table1 

Load

Company code & Key1 as Key, 

Fields,

Key1

from xyz.qvd;

 

Table2;

Load

Company code & Key2 as Key, 

Fields,

Key1

from xyz.qvd;

 

Hope this help

 

Regards,
Abhijit
keep Qliking...
abhijitnalekar
Specialist
Specialist

Hi @Qlikuser201 ,

 

I have attached QVF file for reference.

Regards,
Abhijit
keep Qliking...
Qlikuser201
Creator
Creator
Author

thanks for that however for me I'm getting this error when trying to do that.

The following error occurred:
Field 'Key' not found
abhijitnalekar
Specialist
Specialist

Can you send the screenshot of the script. The same QVF is working properly.

Regards,
Abhijit
keep Qliking...

View solution in original post

Qlikuser201
Creator
Creator
Author

BaseTable

Company CodeAttributed fieldsCount
AAManager2
AACIO1
AAIT Staff1
AADev Staff1
AAManagement Total3
AAStaff Total2
ABManager5
ABCIO2
ABIT Staff3
ABDev Staff2
ABManagement Total7
ABStaff Total5

 

I subdivided this main table into two table(MAinGroup and Subgroup) using load function 

MainGroup:

Load
[CompanyCode] as [CompanyCode],

Atributedfields as Fields,

if(Fields = 'Management Total', 1,

if(Fields = 'Staff Total',2,3) as Key

Resident [BaseTable]

MainGroup:

company codeFieldsKey
AAManagement total1
AAstaff total2
ABManagement total1
ABstaff total2

 

SubGroup

Load
[CompanyCode] as [CompanyCode],

Atributedfields as AttributedFields,

if(Attributed fields = 'Manager' or Fields = 'CIO', 1,

if(Attributed fields = 'IT Staff to Attributed fields ='Dev Staff' ,2,3) as FieldID

Resident [BaseTable]

Company codeAttributed fieldsField ID
AAManager1
AACIO1
AAIT Staff2
AADev Staff2
ABManager1
ABCIO1
ABIT Staff2
ABDev Staff2

 

Now I want to join these two tables using the fieldID and Key, however these are already joined by company code