Sumit Raveendran Posted November 27, 2019 Share Posted November 27, 2019 Hey everyone. I have an eqn: Sum(If(([REP]=1) AND ([TXN]="De"),1,0)) / (Sum(If([TXN]="In",1,0)) Over (AllPrevious([Axis.X])) - (Sum(If(([De]!="YA") AND ([TXN]="De"),1,0)) Over (AllPrevious([Axis.X])) - Sum(If(([De]!="YA") AND ([TXN]="De"),1,0)))) I need to get the avg of this eqn over a time window. My X axis is time: Now, I was able to avg the numerator and denominator separately in a given time window by using the following eqns: Numerator: Sum(If(([REP]=1) AND ([TXN]="De"),1,0)) then Avg([Value]) OVER LASTPERIODS(${RollingWindow},[Axis.X]) Denominator:(Sum(If([TXN]="In",1,0)) Over (AllPrevious([Axis.X])) - (Sum(If(([De]!="YA") AND ([TXN]="De"),1,0)) Over (AllPrevious([Axis.X])) - Sum(If(([De]!="YA") AND ([TXN]="De"),1,0))))then Avg([Value]) OVER LASTPERIODS(${RollingWindow},[Axis.X]) where${RollingWindow} is the input for the rolling window. But I am not being able to get the avg rate by using the eqn: (Sum(If(([REP]=1) AND ([TXN]="De"),1,0)) / (Sum(If([TXN]="In",1,0)) Over (AllPrevious([Axis.X])) - (Sum(If(([De]!="YA") AND ([TXN]="De"),1,0)) Over (AllPrevious([Axis.X])) - Sum(If(([De]!="YA") AND ([TXN]="De"),1,0)))) )then Avg([Value]) OVER LASTPERIODS(${RollingWindow},[Axis.X]). Is there something I am doing wrong and is there an alternative Link to comment Share on other sites More sharing options...

## Recommended Posts

## Create an account or sign in to comment

You need to be a member in order to leave a comment

## Create an account

Sign up for a new account in our community. It's easy!

Register a new account## Sign in

Already have an account? Sign in here.

Sign In Now