Hello @simantsah !
Have you tried doing something similar to the post below and turning {stagename} into an aggregation?