Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
My Conversion Rate Calc is as follows:
Sum(Transactions)/Sum(Average Visitors)
I have the below conditions that state if Conversiion Rate Calc is null then null and if its between 10% and 60% then return the Conversion Rate else make it zero
If(IsNull(Sum(Transactions)/Sum([Average visitors])), 0,
If((Sum(Transactions)/Sum([Average visitors]))>0.6, 0,
If((Sum(Transactions)/Sum([Average visitors]))>0.1, (Sum(Transactions)/Sum([Average visitors])))))
The result is correct for each store but the total is not correct
1018665/3060186=33,3% and not 26563,8%
I've tried this expression but it's not working
Sum(Aggr((If(IsNull(Sum(Transactions)/Sum([Average visitors])), 0,
If((Sum(Transactions)/Sum([Average visitors]))>0.6, 0,
If((Sum(Transactions)/Sum([Average visitors]))>0.1, (Sum(Transactions)/Sum([Average visitors])),0)))), Store, Date))
This works for the rows but it's not giving the correct total.
Hi, instead of a sum of the percentages you need a sum of each of the values separatedly and then calcualte the percentage, something like:
Sum(Aggr((If(IsNull(Sum(Transactions)/Sum([Average visitors])), 0,
If((Sum(Transactions)/Sum([Average visitors]))>0.6, 0,
If((Sum(Transactions)/Sum([Average visitors]))>0.1, (Sum(Transactions)),0)))), Store, Date))
/
Sum(Aggr((If(IsNull(Sum(Transactions)/Sum([Average visitors])), 0,
If((Sum(Transactions)/Sum([Average visitors]))>0.6, 0,
If((Sum(Transactions)/Sum([Average visitors]))>0.1, (Sum([Average visitors])),0)))), Store, Date))
If in script you flag records by Store and date where they accomplish that Sum(Transactions)/Sum([Average visitors])>0.1 and <0.6, you will only need:
Sum({<flagField={1}>} Transactions)/Sum({<flagField={1}>} [Average visitors])
And this will work for rows and for totals, with better performance than using aggr.
Hi, in this case you don't have to use aggr because it will sum each percentage. I don't see why the first expression will return that high %, it should work using the same expression as by store. Is that result with just the first expression or with the aggr applied?
Other expression may be needed if youwant to exclude some stores in the total row
Hi, I need the second expression to work as I am excluding some stores in the total. The second expression is giving me the high%
Can you please share the sample app?
Hi, instead of a sum of the percentages you need a sum of each of the values separatedly and then calcualte the percentage, something like:
Sum(Aggr((If(IsNull(Sum(Transactions)/Sum([Average visitors])), 0,
If((Sum(Transactions)/Sum([Average visitors]))>0.6, 0,
If((Sum(Transactions)/Sum([Average visitors]))>0.1, (Sum(Transactions)),0)))), Store, Date))
/
Sum(Aggr((If(IsNull(Sum(Transactions)/Sum([Average visitors])), 0,
If((Sum(Transactions)/Sum([Average visitors]))>0.6, 0,
If((Sum(Transactions)/Sum([Average visitors]))>0.1, (Sum([Average visitors])),0)))), Store, Date))
If in script you flag records by Store and date where they accomplish that Sum(Transactions)/Sum([Average visitors])>0.1 and <0.6, you will only need:
Sum({<flagField={1}>} Transactions)/Sum({<flagField={1}>} [Average visitors])
And this will work for rows and for totals, with better performance than using aggr.
This worked perfectly, thank you.