4 Replies Latest reply on Dec 27, 2012 1:14 PM by MattRollings

# Prior, Next, Shift functions return type?

I can not point out what is the return type of these functions? numeric value or member?

And if they return a member would this fomula be valid (i need to take avg value of march and june):
avgppl = @avgrange("HRsummary" -> "territory",@list(@currmbr("YearTotal"),@shift(@currmbr("YearTotal"),-3)))

• ###### 1. Re: Prior, Next, Shift functions return type?
Hi,

All the mentioned functions (Prior, Next and Shift) returns values and not members.

Regards
-SM
• ###### 2. Re: Prior, Next, Shift functions return type?
You probably want to use @PREVSIBLING and @NEXTSIBLING if you want members returned.
• ###### 3. Re: Prior, Next, Shift functions return type?
The problem with prev and next siblings is the does not work as i want with level 0 time members, so if i need to jump from june to march i can not use siblings fucntions coz they are not siblings and refer to different parents (Qtr1 and Qtr2)

Thx all, guys
• ###### 4. Re: Prior, Next, Shift functions return type?
just use simple arithmetic combined with other functions

e.g.

If you want sum of base time periods underneath a summary time period, and make the formula generic to work on base time periods:

@SUMRANGE(@CURRMBR(Account),@Relative(@CURRMBR(Period),0))/@COUNT(SKIPNONE,@Relative(@CURRMBR(Period),0))

or, instead if you want the quarter averages at base time periods...

@SUMRANGE(@CURRMBR(Account),@Relative(@Relative(@CURRMBR(Period),-1),0))/@COUNT(SKIPNONE,@Relative(@Relative(@CURRMBR(Period),-1),0))