aapl Posted June 20, 2011 Posted June 20, 2011 I cannot get a calculation to work. I would like to run a certain report every 4 weeks. So for example if the week number of the current date is 4 or 8 or 12 etc. Needs to be ISO calc to work in the uk so 'WeekOfYearFiscal' How do I do this?
comment Posted June 20, 2011 Posted June 20, 2011 Week of year is not a good choice - unless you want to restart the count at the beginning of year. Try something like = not Mod ( Div ( Get (CurrentDate) - 1 ; 7 ) ; 4 ) This may need adjustment depending on when you want the cycle to start.
aapl Posted June 20, 2011 Author Posted June 20, 2011 Could you please explain what 'not mod' and 'div' actually do here? ...and I would like it to restart each year.
comment Posted June 20, 2011 Posted June 20, 2011 Div () returns an (arbitrary) absolute number of week; not Mod ( week ; 4 ) returns 1 (True) for every 4th week, 0 (False) otherwise.. If you want to restart each year, try = not Mod ( WeekOfYearFiscal ( Get (CurrentDate) ; 2 ) ; 4 )
aapl Posted June 25, 2011 Author Posted June 25, 2011 Div () returns an (arbitrary) absolute number of week; not Mod ( week ; 4 ) returns 1 (True) for every 4th week, 0 (False) otherwise.. If you want to restart each year, try = not Mod ( WeekOfYearFiscal ( Get (CurrentDate) ; 2 ) ; 4 ) That's great, just tried this and it works perfectly. Out of interest when I have a calc to name a pdf when running a script to save as pdf I want to display the 4 week period number. I currently have (((WeekOfYearFiscal (DateField))+3) / 4) which displays 5.25 or 9.25 or 13.25 etc ...instead of the 2, 3, and 4 I am looking for. Why is this? what have I done wrong?
comment Posted June 25, 2011 Posted June 25, 2011 I currently have (((WeekOfYearFiscal (DateField))+3) / 4) which displays 5.25 or 9.25 or 13.25 etc ... No, that's not possible. What you have is not a valid expression and the only thing it can possibly return is an error. I want to display the 4 week period number. Try = Div ( WeekOfYearFiscal ( DateField ; 2 ) - 1 ; 4 ) + 1
Recommended Posts
This topic is 5269 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now