Click here to Skip to main content
15,890,374 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have been facing some problem to calculate profit in matrix mlm plan.

I this plan each Node can have 3 nodes

For level 1 Total Node count 3 , parent node will be get benefit of 90 Rs. Means 3 × 30@=90
Level 2 - node count 27 benefit will be
27× 10= 270

Level 3 node count 81 , benefit 81× 5=405

.........and so on ...

What I have tried:

I have tried to calculate profit at time of user registration form sql server stored procedure.
Posted
Updated 10-Feb-20 8:31am
Comments
Richard MacCutchan 10-Feb-20 3:36am    
Please edit your question and show the failing code, and explain exactly where the problem occurs.
Dave Kreskowiak 10-Feb-20 15:31pm    
You do know that MLMs are a scam, right?

1 solution

to me on the basis of what you stated I would utilize a loop and scalar function

I wouldset each level as an increment in a loop. For each increment send to the function, the level and the values associated with that level.

The scalar function would carry all logic for the levels.

Based on the above I am only giving you what is off the top of my head as I feel your question lacks some further detail to answer the question more specifically.

while loop tsql
WHILE (Transact-SQL) - SQL Server | Microsoft Docs[^]


create function tsql


[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900