I want the formula to make the enddate the end of the fiscal year if the end date goes past the fiscal year end date. But when I try to run this formula it highlights the last end and says that a boolean is required here. I want it to return a date, not a boolean.
//@{enddate}
datevar end =...
Ok, to simplify I've decided on a better placement for what I'm trying to achieve. My question now is how do you do a between?
//{@Qtr2mid}
datevar start := {VIEW.START_DATE};
numbervar days := {VIEW.LENGTH_OF_STAY};
datevar end := start + days-1;
numbervar firstquarter :=...
Sorry was out yesterday with a sick little one.
Here is what I got.
One of the following for each Quarter which is used as a column in a cross tab
//{@Qtr1}:
if {@qtrst} = 1 then
{@dayscurrqtr} else
if {@qtrend} = 1 then
{@daysnextqtr}
One of these for quarter 2, 3, and 4
//{@qtr2total}...
The first three formulas are used in a cross tab. The forma sets a number which is dependant on which formula is calling it.
so
//@forma
numbervar form = 1; \\ or 2, 3 depending on which called this formula
if form = 1 then
dothis else
if form = 2 then
dothis else
if form = 3 then
dothis
I am thinking no but its worth
Can you send parameters from one formula to another? So that i can have a couple different formulas call one other formula and depending on the parameter they send over it will set the condition.
ie.
@form1, @form2, @form3 all call @forma
For the conditional...
This is the changes I made to @dayscurrqtr. Correct me if I am wrong because like I said I'm not strong with date calculations. I'm now working on the mid quarter calculations for multiple quarter visits.
@dayscurrqtr
datevar start := {DAYS_STAYED_VIEW.START};
numbervar days :=...
Thanks LB, I think I almost have it worked out and will post it when/if I'm done. The above example is a two-quarter period, my mistake though for not being more clear in the original post. the rest of the changes I'm making for it being up to a four quarter stay is dependent on the daycurrqtr...
@dayscurrqtr isn't working out properly.
Stay begin May 1, 2011
Stay length 142 days
Stay end date Sept 19, 2011
@dayscurrqtr is coming out at 31 days when it should be 50 or 51 days.
For fields that can have null values I do a coalesce(field_name, default_null_value). The default null value can be set to text, numbers or just a blank
coalesce(field_name, "NULL")
coalesce(field_name, 0)
coalesce(field_name, "")
Oh and I changed @daysnextqtr to figure out what the last qtr days are
//{@daysnextqtr}:
datevar start := {DAYS_STAYED_VIEW.START_DATE};
numbervar days := {DAYS_STAYED_VIEW.LENGTH_OF_STAY};
datevar end := start + days-1;
numbervar dysnextqtr := 0;
if datepart("q", end) - datepart("q",start)...
ok, I made two more formulas called qtrmid1 and qtrmid2 which test to see if there are 1 or 2 quarters in the middle of the first and last quarter of a stay. So now i'm trying to get the @Qtr2 to do this:
if {@qtrst} = 2 then
{@dayscurrqtr}
else if {@qtrend} = 2 then
{@daysnextqtr}
else if...
Looks good, two things I should have mentioned. The year for the first three quarters must be equal to a parameter year (ex 2011 entered) and the last quarter would be the parameter year plus 1 (2012). This way only stays from 2011-2012 fiscal year would show up (not previous/future years)...
can I do something like:
if Month({DAYS_STAYED_VIEW.START_DATE}) in 4 to 6 then
( if (TotalOfDays > LastDayOfMonth) then
First Quarter.length_Of_stay = 2;
Second Quarter.length_of_stay = 8;
else
' First Quarter')
Another Quarter N refers to those stays that spans more than one quarter. When it falls into one of these quarters I need to split the length of stay between the two quarters that the stay spanned. Right now it just throws the total number into Another Quarter N rather than Quarter 1 = 2 days...
Sorry yes,it should read April 1 - June 30 is Quarter 1, July 1 - Sept 30 is Quarter 2, Oct 1 - Dec 31 is Quarter 3 and Jan 1 - March 31 is Quarter 4.
The remaining step is how can I divide the length of stay between multiple quarters.
Examples
Guest 1 first night was June 2 and she stayed for...
Trying to determine number of days people stayed in bed and breakfast by quarter. If one person stayed 14 days and there was 2 days in one quarter and 12 in next quarter then the days need to be split up.
The following formula right now will put the days into the proper quarter and shows which...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.