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: 
Yousef_Amarneh
Partner - Creator III
Partner - Creator III

Analyze data that have network structure

Hi All,

I have 2 tables, the first one contains 3 columns (for example): (FromCompany (FK),ToCompany(FK),LineLength)  and the second one contains (CompanyID (PK) ,details ...).

1. what is the best way to make the relation between these tables knowing that FromCompany and ToCompany are related with CompanyID.

2. Lets consider that CompanyID contains 1,2,3,4 as data rows and FromCompany contains 1,2,3 and ToCompany contains 2,3,4 as the follwoingEx.jpg

now I need to do some analysis for this example such as what is the line length between comp 1 and comp 4 (the answer is 75), which compay is provided by comp 3 (the answer is comp 4) and so on, can I do such analysis on QlikView and how?? what's the best way to build the schema and the relations??

I need your help guys ASAP .

Thanks,

Yousef Amarneh

Yousef Amarneh
6 Replies
Not applicable

Is it like the num in companyto is always a succeding num of Comp from(i.e., alway 1-2, 2-3, 3-4, 4-5)?? if so its a direct solution.

Would relate Compfrom to the the Comp ID with an alias like suppose CompID2, and Create objects on the front end to select the from and to. where those selections on the object define variables with the selected number Suppose fromcomp num is vFrom and to comp number is vTo. Use set analysis for the total,

Sum({$< CompID2>= $(vFrom),              CompID2<$(vTo)>}              line length).

If I have a better understanding with the data or have real data we can get better solutions though...!!Interesting one, let me know if there are anymore conditions...!!

Yousef_Amarneh
Partner - Creator III
Partner - Creator III
Author

Can you please explain your answer within a small QVW file.

Yousef Amarneh
swuehl
MVP
MVP

Hi Yousef,

I think your problem could be seen as a hierarchy, right? There are some built in mechanism to create a hierarchy from data like yours, which should allow you then to answer like above questions.

Please have a look at the manual or here in the forum, search for hierarchy or hierarchybelongsto keywords preceding the load the statement. I remember there are some examples in the manual.

Regards,

Stefan

Not applicable

Hi Yousef,

Can you send me your QVW file with some records on both tables or some records from both tables?

Regards,

Sajeevan

Yousef_Amarneh
Partner - Creator III
Partner - Creator III
Author

The attached file contains an small example about what we are talking about. I need to know what is the best way to connect these 2 tables with each others.

Yousef Amarneh
Not applicable

Can you check this QVW and let me know. You need to hold control and select the 'key'(it is a drop down select) which defines your path it gives you the total.