Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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 follwoing
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
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...!!
Can you please explain your answer within a small QVW file.
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
Hi Yousef,
Can you send me your QVW file with some records on both tables or some records from both tables?
Regards,
Sajeevan
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.
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.