Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have created a hierarchie (geo type) in Qlickview:
This is the file:
ans this is the script:
Jerarquia_pais:
Hierarchy(cod_geo, cod_padre, desc_geo, desc_padre, desc_geo, jerarquia_geografica , '|', profundidad) LOAD
cod_geo,
cod_padre,
desc_geo
FROM
(ooxml, embedded labels, table is Hoja1);
Now I have a listbox with the hierarchie working properly:
the fact table is at low level of the hierarchie (ciudad).
My question:
Now I can only select in the listbox al the low level (ciudad), is there anyway of selectiong at a higer level (pais)?, and filtering that rows in the chart (see only data of this selected level)?
for examploe: select España and see data of: Madrid, Sevilla, Valencia, Zaragoza...
Thanks in advance.
I think you're looking for the HierarchyBelongsTo function instead of the Hierarchy function. You can find an explanation in this blog post: Unbalanced, n-level hierarchies
Thanks Gyspert,
Now I have created a HierarchyBelongsto.
Jerarquia_pais2:
HierarchyBelongsto (cod_geo, cod_padre, desc_geo, cod_padre, desc_padre, nivel)
LOAD
cod_geo,
cod_padre,
desc_geo
FROM
(ooxml, embedded labels, table is Hoja1);
My problem now: how can I make a listbox od treeview typw with this hierarchy??
I needd, something like:
Thanks in advance!!
Here is a clipping from Henric Cronström's excellent article about Hierarchies
that shows probably what you are looking for. You need to have a Path with some kind of separator which you can specify - like for instance a /
You can link your Jerarquia_pais2 hierarchybelongsto table with another table created with the hierarchy function. See the Treebridge and Trees table in the attached example. The Trees table contains a Treepath field that is used in a listbox to select a district. In the pivot table this district and the underlying districts are shown.
Note, there's also a way to select entire subtrees without a hierarchybelongsto table. First collapse the parent of the subtree you want to select and then select the parent node of that subtree. If you then expand it you'll see that the nodes below it are also selected. If you expand the node first and then select it only the node itself will be selected.