Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I have created a couple of sheets, each of which is being driven by a list box organized as a tree. Both of these boxes are populated from data loaded via the hierarchy command:
// product codes
Hierarchy (product_code_id, parent_product_code_id, [Product Code], [Product Code Parent] , [Product Code] , [Product Code Path], "/", ProductDepth)
SQL SELECT "parent_product_code_id",
"product_code_id",
"product_code_name" as [Product Code],
"sort_seq" as [Product Sort Seq]
FROM "MSP_New_Reporting".dbo."product_code";
// sales codes
Hierarchy (sales_code_id, parent_sales_code_id, [Sales Code], [Sales Code Parent], [Sales Code], [Sales Code Path], "/", SalesDepth)
SQL SELECT "parent_sales_code_id",
"sales_code_id",
"sales_code_name" as [Sales Code],
"sort_seq" as [Sales Sort Seq]
FROM "MSP_New_Reporting".dbo."sales_code"
order by "sort_seq";
I have gone through the property sheets of both list boxes and other than the title and the 'field' they appear to be identical. I even took the one which works (product code), copied it to the other page, changed the field to sales code and I have the same problem.
That problem is that when the main data is filtered on the selected product code I see all the appropriate rows for that code and all child codes. this is what i want. When I do the same thing with the sales code all i get are the rows that match the sales code exactly.
Where I think may point to the problem is the current selections box. When i select a parent product code the current selection shows a value of '41 of 200'. When i select a sales code the value in the current selections box is a fully qualified path of values.
in both cases the field for the list box is the 'Path' field; [Product Code Path] and [Sales Code Path].
Can anyone point me to where the problem may be?
TIA,
Matthew Fleck
From your explanation, it sounds like the problem isn't with the list box, but with your data model. Try comparing how your hierarchy tables are linked back to the other tables in your data model. Is that linking the same? I'm guessing it's different which is why you're getting different results for each field in the list boxes.
Thank you Nicole, this suggestion was very helpful. It turns out in my main data result set I need to have both the ID field and the name field for the values listed in the hierarchy. Once I did that I noticed the table viewer view and data had consistent formatting between the two lists/trees. However, I still do not have the sales code tree behaving correctly. I am still trying to track down any other data issues which might be the cause.
- Matthew