Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
mohan_1105
Partner - Creator III
Partner - Creator III

How to multiply a specific value with each branch in hierarchy data?

Greetings!!

I am dealing with hierarchy data, where I wanted to sum all the referral turnover and also the turnover of my referral's referral. Data has different levels, for instance, if I select the person from level 1 then his/her turnover is added up by his referral who is in next level i.e level2 (turnover) * 0.5 and level 3 by 0.3 and rest of the level by 0.2.

My actual data looks like,

Capture.JPG

Hierarchy data after importing into Qlik,

Captue.JPG

Here for example, If I select A HAREESH BASHA from Level2 then calculation should be like,

A HAREESH BASHA (TurnOver) + A HAREESH BASHA referral(TurnOver) *0.5 +A HAREESH BASHA referral's referral(TurnOver)*0.3

I have no idea how to achieve it. Please help. I have attached the QVF for your convenience

1 Solution

Accepted Solutions
mohan_1105
Partner - Creator III
Partner - Creator III
Author

Using Ancestor key in hierarchy function, we can multiply the specific value with each branch.

View solution in original post

5 Replies
vinieme12
Champion III
Champion III

Can you also post the excel?

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
mohan_1105
Partner - Creator III
Partner - Creator III
Author

Yeah, attached !!

mohan_1105
Partner - Creator III
Partner - Creator III
Author

Using Ancestor key in hierarchy function, we can multiply the specific value with each branch.

agigliotti
Partner - Champion
Partner - Champion

Hi @mohan_1105 ,

Please, could you post the script ?

I have the same requirements.

Many thanks in advance.

Best Regards

mohan_1105
Partner - Creator III
Partner - Creator III
Author

Hi @agigliotti , The ancestor key is a syntax in the hierarchybelongsto() function, with that we can Identify the branch level in the hierarchy.

Thanks.