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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
farheenayesha
Creator
Creator

How to resolve many to many relationship

Hi,

Please help me to get one to one relationship between Product and dashboard.

I have user and document name in one table(User_Doc) and Users and products in another table(User_Prod)

I want to get one to one mapping between product and dashboard.

Example:

If i select Prod1, i should get the dashboards related to prod1(Dashboard1-Prod1.qvw,  Dashboard2-Prod1.qvw,  Dashboard3-Prod1.qvw)  only. But currently i am getting dashboards related to other Products also.

Please find the sample data and qvw attached.

1 Solution

Accepted Solutions
shiveshsingh
Master
Master

Try below script, link with calculated Product field.

T1:

LOAD Authenticated_User,

     mid(DocName,11,5) as Product,DocName

FROM

[..\Desktop\User_Doc_1.xls]

(biff, embedded labels, table is [User_Doc $]);

T2:

LOAD Users, Product

FROM

[..\Desktop\User_Doc_1.xls]

(biff, embedded labels, table is [User_Prod $]);

View solution in original post

5 Replies
farheenayesha
Creator
Creator
Author

Please ignore the above example and attached data. Please consider the latest data attached.

In the current data, if i select Pord6 it is showing the dashboards associated with Prod5 as well. But i want to get only Prod6 dashboards when i select Prod6 from Products list box. Please find the snapshot below.

Capture.JPG

Basically i want one to one mapping between Products and dashboard.

Prod1  ->  Dashboard-Prod1-Std.qvw

Prod2  ->  Dashboard-Prod2-Std.qvw

etc

shiveshsingh
Master
Master

In your data, Prod6 is corresponding to  user6 and User13

and in other excel , user 13 and user 6 are linked with below dashboards.

Dashboard-Prod5.qvw

Dashboard-Prod5_New.qvw

Dashboard-Prod5_std.qvw

Dashboard-Prod6-New.qvw

Dashboard-Prod6.qvw

shiveshsingh
Master
Master

Try below script, link with calculated Product field.

T1:

LOAD Authenticated_User,

     mid(DocName,11,5) as Product,DocName

FROM

[..\Desktop\User_Doc_1.xls]

(biff, embedded labels, table is [User_Doc $]);

T2:

LOAD Users, Product

FROM

[..\Desktop\User_Doc_1.xls]

(biff, embedded labels, table is [User_Prod $]);

farheenayesha
Creator
Creator
Author

Thank you Shivesh. This is what i was looking for.

shiveshsingh
Master
Master

Glad to know it worked