I created a macro that generates keys for the Tree interface tool.
The main idea was to build a tool that can accept any number of hierarchy levels for the Tree tool,
to avoid modifying workflow every time for a different number of levels.
Relevant fields need to be selected to create keys for the Tree tool.
Hierarchy Parent-Child will be created based on a selected fields order
(selected field on the top will be Parent, selected field on the bottom will be Child)
If fields in a dataset are not positioned accordingly, the Selection tool can be used before connecting to the macro.
The macro has two outputs:
The macro offers two sorting options for values in the Tree tool.
Macro can work with string, numeric, date-time, and bool data types. Keys will be created without affecting original data types.