When a "Root Post" is created, it can be shared by others. Those shares can then be shared again, creating a Viral Chain.
To measure the "Viral Velocity," the marketing team needs to know the Maximum Depth (how many levels deep the chain went) and the Total Reach (total number of shares) for every Root Post.
Find the viral metrics for every post_id that is a "Root Post" (where parent_post_id is NULL).
| post_id(INTEGER) | parent_post_id(INTEGER) | user_id(INTEGER) |
|---|---|---|
| 1 | null | 10 |
| 2 | 1 | 11 |
| 3 | 1 | 12 |
| 4 | 2 | 13 |
| 5 | 2 | 14 |
| 6 | 4 | 15 |
| 7 | 6 | 16 |
| 8 | 3 | 17 |
| 100 | null | 20 |
| 101 | 100 | 21 |
| 102 | 100 | 22 |
| 500 | null | 30 |
| root_post_id(INTEGER) | max_depth(INTEGER) | total_shares(INTEGER) |
|---|---|---|
| 1 | 4 | 7 |
| 100 | 1 | 2 |
| 500 | 0 | 0 |