Qlik Community

QlikView Documents

Documents for QlikView related information.

Rollup hierarchy's Node Amount

samane_ramezani
Contributor

Rollup hierarchy's Node Amount

Hi Qlikers

I prepare sample to show how can rollup node's amount in hierarchy

1.png

to do this  we need two hierarchy:

one of them hierarchy with CountryName:

               Hierarchy(ID,ParentID,CountryName,,CountryName,CountryHierarchy,'/',Depth)

and another one hierarchy with code

              Hierarchy(ID,ParentID,ChildNodeCode,,ChildNodeCode,CountryHierarchy2,'/',Depth2)

and at the last we need For loop to assign SalesAmount to each Parent:

             FOR each i in 17,13,9,5,1

             ForTBL:

             LOAD

             Mid(CountryHierarchy2,$(i),3) as ChildNodeCode,

             sum(SalesAmount) as Sum_LowerLever_SalesAmount  

             Resident ResultTable

             Group by Mid(CountryHierarchy2,$(i),3);

             NEXT;

in attached file you can find  the sample qvw file

sincerely

Samane Ramezani

Attachments
Comments
santiago_respane
Valued Contributor

Very interesting!

Thanks for you contribution!

Regards,

Version history
Revision #:
1 of 1
Last update:
‎08-06-2017 06:37 AM
Updated by: