Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I have a data set as shown below.
I want to make a tree structure by using Hierarchy function in QV
RegionName | StateName | CityName |
NORTH | Delhi | Delhi |
NORTH | Haryana | Gurgaon |
SOUTH | PONDICHERRY | Pondicherry |
SOUTH | TAMIL NADU | Chennai |
SOUTH | TAMIL NADU | Villupuram |
WEST | GUJARAT | Surat |
WEST | Maharashtra | Kalyan-Dombivli (M Corp.) |
WEST | Maharashtra | Pune |
Please help me.
On the dimension tab of the properties window click on Edit Groups. Then create a new group and add RegionName, StateName and CityName.
Hi gwassenaar,
Thanks for you respone.
But my requirement is how to make a tree view structure by using load Hierarchy function in QV.
I can make this structure by righting an expression on a list box like this
=RegionName &' /' & StateName & '/' & CityName and then by checking the Tree View option
But here the problem is that i can not select Parents like West,North etc i can only select City name.
So i want to know if this tree view structure is possible by using Hierarchy load function in Qlikview and if it is possible then how to use it
Thanks
Hi,
it is necessary to create adjacent nodes table (here it is ITEM named table) and then to construct hierarchy table using it.
Reload document with this script and set NAME_FOR_TREE as a field name in list box, with 'Show as TreeView' selected.
Directory;
ORG_TABLE:
LOAD * INLINE [
RegionName, StateName, CityName
NORTH, Delhi, Delhi
NORTH, Haryana, Gurgaon
SOUTH, PONDICHERRY, Pondicherry
SOUTH, TAMIL NADU, Chennai
SOUTH, TAMIL NADU, Villupuram
WEST, GUJARAT, Surat
WEST, Maharashtra, Kalyan-Dombivli (M Corp.)
WEST, Maharashtra, Pune
];
ITEM:
LOAD Distinct CityName as VALUE, CityName & '-City' as NODE_ID, StateName & '-State' as PARENT_NODE_ID resident ORG_TABLE;
LOAD Distinct StateName as VALUE,StateName & '-State' as NODE_ID, RegionName & '-Region' as PARENT_NODE_ID resident ORG_TABLE;
LOAD Distinct RegionName as VALUE,RegionName & '-Region' as NODE_ID, RegionName & '-Region' as PARENT_NODE_ID resident ORG_TABLE;
HIERARCHY_TABLE:
Hierarchy(NODE_ID_H,PARENT_NODE_ID_H, ID, PARENT_NAME, NAME, NAME_FOR_TREE) load
NODE_ID,
NODE_ID as NODE_ID_H,
PARENT_NODE_ID as PARENT_NODE_ID_H,
VALUE as ID,
VALUE as NAME
resident ITEM;
Hi Krunoslav,
This is exactly what iam looking for.
Thank you very much for the help.
Thanks for your answer! It is very useful..
But I still have a question..
Which field should I use to link the hierarchy table with my fact table?
I thought it must the the Node_ID, but that field has the prefix "-City, -State.." and that prefix do not exists on my fact table..
Thanks!
Hi..
Can you please help me creation of org chart in Qlikview.When i am trying to create org chart it saparate data based on the dashes but i have to saparate data based on the | in org chart..
please help me..
Thanks & regards,
Chandini
Hi,
take a look into help for Hierarchy statement, there is property PathDelimiter, that can be used to define delimiter other than default '/'.
You should also update List Box, under its Properties->General set Show As TreeView with separator |
regards
I was looking for the same and you made my work simple. Thanks Krunoslav Pap