Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Im trying to find the variance of this calculation : (Sum(tkt_amt) - sum(pay_or_cancel_amt))/count(session_id_unique)
Based on the users changes in a set analysis. Example of the set analysis I have that works for variance on a simple sum calculation (this is to find the yearly/monthly/weekly variance)
Sum({$<[month]={"$(=Date(AddMonths(Max(month), -1), 'WW-MMM-YY'))"}>} tkt_amt) -
Sum({$<[month]={"$(=Date(Max(month), 'WW-MMM-YY'))"}>} tkt_amt)/
Sum({$<[month]={"$(=Date(AddMonths(Max(month), -1), 'WW-MMM-YY'))"}>} tkt_amt)
How do I include this calculation: (Sum(tkt_amt) - sum(pay_or_cancel_amt))/count(session_id_unique)
into this calculation
Sum({$<[month]={"$(=Date(AddMonths(Max(month), -1), 'WW-MMM-YY'))"}>} tkt_amt) -
Sum({$<[month]={"$(=Date(Max(month), 'WW-MMM-YY'))"}>} tkt_amt)/
Sum({$<[month]={"$(=Date(AddMonths(Max(month), -1), 'WW-MMM-YY'))"}>} tkt_amt)
I assume it would be easier if the calculation above is already defined like a dimension in master item but I cant include measures master item inside an expression. Can someone help me please
It seems in your variable you do not have the "=" symbol on front of your expression , so change your variable with the below:
= (Sum(tkt_amt) - sum(pay_or_cancel_amt))/count(session_id_unique)
Hello,
As I can understand the issue is that tkt_amt is calculated from:
Sum({$<[month]={"$(=Date(AddMonths(Max(month), -1), 'WW-MMM-YY'))"}>} tkt_amt) -
Sum({$<[month]={"$(=Date(Max(month), 'WW-MMM-YY'))"}>} tkt_amt)/
Sum({$<[month]={"$(=Date(AddMonths(Max(month), -1), 'WW-MMM-YY'))"}>} tkt_amt)
and you need to calculate the below expression:
(Sum(tkt_amt) - sum(pay_or_cancel_amt))/count(session_id_unique) that tkt_amt based on the result of the first expression?
If is the case create a variable for the calculation of the tkt_amt and then use the variable on your final expression like below :
(Sum($(varialbe_name)) - sum(pay_or_cancel_amt))/count(session_id_unique)
Its actually the other way round. I need this (Sum(tkt_amt) - sum(pay_or_cancel_amt))/count(session_id_unique) to be replaced with tkt_amt in this variance calculation.
Sum({$<[month]={"$(=Date(AddMonths(Max(month), -1), 'WW-MMM-YY'))"}>} tkt_amt) -
Sum({$<[month]={"$(=Date(Max(month), 'WW-MMM-YY'))"}>} tkt_amt)/
Sum({$<[month]={"$(=Date(AddMonths(Max(month), -1), 'WW-MMM-YY'))"}>} tkt_amt)
So do I create a variable for this calculation (Sum(tkt_amt) - sum(pay_or_cancel_amt))/count(session_id_unique) ?
I created the variable but there is no value showing. Where am I going wrong?
vSpS = (Sum(tkt_amt) - sum(pay_or_cancel_amt))/count(session_id_unique)
Sum({$<[month]={"$(=Date(AddMonths(Max(month), -1), 'WW-MMM-YY'))"}>} vSpS) -
Sum({$<[month]={"$(=Date(Max(month), 'WW-MMM-YY'))"}>} vSpS)/
Sum({$<[month]={"$(=Date(AddMonths(Max(month), -1), 'WW-MMM-YY'))"}>} vSpS)
Try to change vSpS to $(vSpS ) on your expression:
Sum({$<[month]={"$(=Date(AddMonths(Max(month), -1), 'WW-MMM-YY'))"}>} $(vSpS )) -
Sum({$<[month]={"$(=Date(Max(month), 'WW-MMM-YY'))"}>} $(vSpS ))/
Sum({$<[month]={"$(=Date(AddMonths(Max(month), -1), 'WW-MMM-YY'))"}>} $(vSpS ))
I'm getting this error
It seems in your variable you do not have the "=" symbol on front of your expression , so change your variable with the below:
= (Sum(tkt_amt) - sum(pay_or_cancel_amt))/count(session_id_unique)
It worked! Thank you so much!