on 05-23-2015 3:47 PM
Have a look at the SQL generated and see if the measure value that is causing you problems would logically return previous year or current year transactions. If you have any doubts, raise them with the universe designer as they will know your objects better than we do.
The construct for a prior year object should be a case statement along the lines of (in pseudo code terms):
sum(case when year(transaction_date) = year(currentdate)-1 then transaction_value else 0 end)
The other way to achieve this is through a smart calendar table, such that the calendar dimension gets updated each night to denote certain things - last week flag, yesterday flag, etc In your case, there would be a prior year to date 1/0 flag and prior year to date would simply be:
sum(transaction_value * prior ytd flag)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Create a new varaible Cumulative Prior Year = previous([Cumulative - Actual Year]) and use this in thae table.
Thanks,
Tanveer
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In query where you are fetching previous data you have applied any date condition like
let's say in current query you are fetching data for May month now in case of previous month you have to apply condition where month = April where you are fetching data for previous month.
I hope you understand what I mean.
Beacuse I am not able to see any condition in either of your queries.
Anila, thank you for your input, I somehow mised your message earlier. What do you mean in part of your last sentence "use this variable in your calculation" which variable you referring too I should use?
Swapnil, I understand what you want me to do but I want the prompt option and not having to enter Months in query panel. Appreciate all ur help please.
Thanks Anila, Am confused with your formula.
My Actual Year Measure is "Cumulative - Actual Year". Can you please refine your formula for me please am confused. Appreciate this.
=[Amount] in ([Prev Year]) - I do not understand this (is the amount supposed to be my actual measure or prior measure?
For [Prev Year]= ToNumber(UserResponse("Enter a Year");" ") -1 (I beleive this is to give user response of period selected?
Yes. It is the actual amount measure to be used in place of [Amount].
For [Prev Year]= ToNumber(UserResponse("Enter a Year");" ") -1, just create a variable using this formula and verify whether you are able to fetch prev year.Merge year objects. Use this prev year variable in the calculation of amount variable and check whether you are getting expected results for prev year.
Grtz
-Anila.
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.