Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How To Create Hierarchy Levels?

Dear Community,

How can I create a hierarchy for the levels such that selecting a parent will automatically reflect selections on all its childs available?

I have a field named Code which is used to generate Level1,Level2,Level3 and Level4 fields.

I have attempted obtaining the same with the hierachy keyword, but seems like I could use your help

My requirement in to select a value in the Code field and see its children in the levels 1,2,3 and 4.

For example,

Selecting 11000000000000000000 in the Code field must select

1. 11000000000000000000 in Level1 field.
2. 11010000000000000000, 11020000000000000000,11030000000000000000, 11040000000000000000  in Level2 field.
3. 11010100000000000000, 11010200000000000000,11010300000000000000,11010800000000000000,11010900000000000000 in Level 3
4. 11010101000000000000 in Level 4

(Note: The child levels are generated from the code in the main field)

Please find a sample file attached.

Regards & Thanks,

-Shahbaaz.

1 Solution

Accepted Solutions
Not applicable
Author

Hi,

find attached file, it may help you

Niranjan M.

View solution in original post

8 Replies
nirav_bhimani
Partner - Specialist
Partner - Specialist

HI,

Refer to following attachment for hierarchy, hope this will help you.

Not applicable
Author

Hi,

find attached file, it may help you

Niranjan M.

Not applicable
Author

Niranjan,

Thank you for your solution

It's working but the resultant code is being treated as a string apparently due to concatenation.

However, I need this column values to be numerals so that it gets associated with other fields/values in my data model.

Making this resultant codes (for Level1,Level2,....) as numerals will certainly solve my issue.

Can you suggest something?

Regards &  Thanks,

-Khaled.

Not applicable
Author

Hi,

Use num#() function for those fileds.

eg:

num#(Left(Code,2) & '000000000000000000','##################') as Level1,

Niranjan M.

Not applicable
Author

Niranjan,

Using Num# des not work but with the evaluate() function.

Thank you 

Regards,

-Khaled.

Not applicable
Author

Hi,

The code works fine but does not show any possible values for child levels when I am selecting the main level.

For example, selecting Code does not show any possible in Level1, Level2, Level3 and Level 4. The hierarchies work from Level 1 (not from the actual Code that is already existing in the script ) and all the levels down.

How can I get it to work from not just Level 1 but from the actual Code field itself?

Regards & Thanks,

-Khaled.

Not applicable
Author

Please post a sample qvw.

so that i can help you.

Niranjan.

Not applicable
Author

Niranjan,

Thank you for your response.

The hierarchies work from Level 1, Level 2 and so on..
But selecting a code in the main Code field does not show any possible values in Level 1, Level 2.....etc.


For example, searching for a code that starts with 11******************* will give me all the related values in
Level1, Level2, Level3 and Level4.

But selecting (say) 11010200000000000 in the main Code field does not show any association in the level1, level2,level3, level 4 field.
But if the same code(which falls in Level3) is selected in Level 3 field, i can see a child department in level4, which is correct.

The requirement is to get the code hierarches working from the actual CODE field as well and not just from Level1 or Level2, etc.

PFA.

Regards,

-Khaled