Hello All,
I have to create a query in which my columns will have current year and previous year and my rows will have 0calmonth field. Now i need to show data accordingly for example:
I have to show last 12 month data for the current year and previous year respectively. I am not able to apply any CKF and RKF to derive at particular structure. I have created a structure in rows for month calculation with offset but previous year value is not coming. I also tried cell formula but not able to apply for previous year. Any help will be appreciated.
currentyear previous year
01.2011 1000 800(this is 01.2010 data)
02.2011 2000 1200(this is 02.2010 data)
......
.....
12.2011 3000 2000
Thanks & Regards
Nishant
Hello Nishant
You can create a structure in rows.
Put twelve formulas. Each one of them will add two lines (2x12 24 lines) which will be the current and the previous year filtered. If you want to have it on two different colums you should have two different year characteristics one for the rows and one for the columns.
Thank you
Yiannis
Hi Nishant,
You will have to restrict the current year key figure with offset (month-12 to month) and for the previous year you will have to set the offset like (month-24 to month-12).
Or else you can easily achieve this by using two Customer Exit variables - One for Current Year and One for Previous Year.
Let me know if you need the code.
Regards, Joe
I think you have to make 12 different RKF each restricting one month with -1 offset for the calendar month. Make these offset RKF Constant Selection.
Please let me know if you require more details about how to achieve this pattern.
Regards,
Farrukh
I don't know why many replies for such hardcoding is really necessary! In X-axis, place 2 elements. #1 : keep the 'Year' & restrict it with the following [YearVar] [YearVar-1]. In Y-Axis there must be 2 elements, #1 0CALMONTH element & #2 another structure which includes a RKF, which you can create with a "range" option to choose [MonthVar] to [MonVar-12] plus the KF. This must solve your issue. Thanks, Arun Bala
Hi Arun,
Yes, you are right that hardcoding such way is not a good practice but the replies for month and hardcoding of 12 and 24 were given because of what Nishant has requested for
I have to show last 12 month data for the current year and previous year respectively.
We all know that year can be directly used for year and previous year values. But not if we need rolling month to month values.
Regards, Joe
Thanks Yiannis, jordan, farrukh and arun for your replies,
I tried all of your solution but nothing is working.
I am getting values for current year but not for previous year
Suppose,
user has entered 01.2012 as input then my output is
current year previous year
01.2012 1000 0
if user is inputing 01.2013
then my required output should be
current year previous year
01.2013 xyz 1000(the value 01.2012 will become previous year).
But i am not getting any value in previous year
Also creating 24 offset variable will not serve my purpose, i need only current year/months offset variable, not the previous year/ months offset variable. I will only create 12 current year months offset variable and need to show values correspondingly for current year and previous year.
Hi Nishant,
I guess i misunderstood your requirement as you had said
I have to show last 12 month data for the current year and previous year respectively.
I thought you need to see last 12 months data and also last 12 months data for previous year.
looking at what you require now, if you have cal year, you could do what Sanjeev and Arun have suggested
or for the current year KF restrict with the input variable and for previous year Key figure restricting with same variable and setting the offset of the variable as -12 should fetch the required result.
Regards, Joe
Hi Nishant
If you are not getting the previous year values then you have placed your date filter in a wrong place.
What Arun gave for solution was pretty simple and i think you should follow it if you want a simple report.
What i gave you is a structure, i did a mistake a put year in both axis but you can use in rows only month. I saw your output and i thought you want something solid to give you always 12 months even if you are not having sales. In any case you can choose what ever you want.
I am confused with the expression "Last 12 months", if your user will give 05.2012 in the selection then the output will be from 01 until 05.2012?
Thank you
Yiannis
Hi yiannis,
i need solid last 12 month, suppose user gives 05.2012 then my output will be like.
Currentyear Previousyear
05.2012
04.2012
.
.
.
06.2011
I have applied all the mentioned solution but not getting previous year value. If i dont restrict my month with offset then my month calculation is coming wrong as its coming equal to previous year months like user entred 05.2012 then
Currentyear Previousyear
05.2011
04.2011
.
.
.
06.2010
my current year months are also coming but my purpose is gone.
Thanks
how you fixed the columns? If you did what Arun said you should have two restrictions with a common variable. [yearvariable] in the first one, and the second one will have the same variable with -1 offset.
hi nishant,
i think urs question is simple & u just need to do is take ( 0calmonth & 0fiscyear) in rows and take your required key figure in column ( & create two selections in which first selection you will restrict that key figure with 0fiscyear and in second selection you will restrict the key figure by (0fiscyear-1). and you will get the resulta like below.
rows columns
0calmonth 0fiscyear currentyear previous year
01.2011 2011 1000 800 ( 01.2010)
02.2011 2011 2000 1600.( 02.2010)
12.2011 2011 3000 2400 ( 12.2010).
and you don't need to create 12 rkf or ckf.
regards
sg2107
Dear Sanjeev,
Thanks for replying,
I tried to do what u told me, first i cannot use fiscal year, so i used calyear and then restrict my query.
when i ran for user input as 01.2013,
the data is showing in previous year now but my calyear and month value is showing as 01.2012 instead of 01.2013. Also i need to show only last 12 month data not all data. Last 12 month current year and corresponding values for previous year.
Thanks