Can a *REC be too long?

Hi,
I am working in a YTD model where I have two accounts. On account 1 the users enter data, for some categories month by month for others all 12 months of a year at once.
The requirement is to calculate the cumulative of the YTD values divided by the monthnumer and store it on a second account.
For example:
ACCOUNT1 (input)
YYYY.01     1
YYYY.02     2
YYYY.03     3
YYYY.04     4
ACCOUNT2 (to be calculated by a script)
YYYY.01     1 / 1
YYYY.02     (1 + 2) / 2 = 1.5
YYYY.03     (1 + 2 + 3) / 3 = 2
YYYY.04     (1 + 2 + 3 + 4) / 4 = 2.5
I have come up with this script
*SELECT(%DIM_SRC%,[ID],"DIM1","[ACTIVE]='Y' ")
*CALCULATE_DIFFERENCE = 0
*XDIM_MEMBERSET ACCOUNT=ACCOUNT1
*XDIM_MEMBERSET DIM1=%DIM_SRC%
*XDIM_MEMBERSET TIME=%TIME_SET%
*WHEN TIME.MONTHNUM
*IS 1
*REC(EXPRESSION=%VALUE%,ACCOUNT=ACCOUNT2)
*IS 2
*REC(EXPRESSION=(%VALUE%+GET(TIME=PRIOR(1)))/2,ACCOUNT=ACCOUNT2)
*IS 3
*REC(EXPRESSION=(%VALUE%+GET(TIME=PRIOR(1))+GET(TIME=PRIOR(2)))/3,ACCOUNT=ACCOUNT2)
*IS 4
*REC(EXPRESSION=(%VALUE%+GET(TIME=PRIOR(1))+GET(TIME=PRIOR(2))+GET(TIME=PRIOR(3)))/4,ACCOUNT=ACCOUNT2)
*IS 5
*REC(EXPRESSION=(%VALUE%+GET(TIME=PRIOR(1))+GET(TIME=PRIOR(2))+GET(TIME=PRIOR(3))+GET(TIME=PRIOR(4)))/5,ACCOUNT=ACCOUNT2)
*IS 6
*REC(EXPRESSION=(%VALUE%+GET(TIME=PRIOR(1))+GET(TIME=PRIOR(2))+GET(TIME=PRIOR(3))+GET(TIME=PRIOR(4))+GET(TIME=PRIOR(5)))/6,ACCOUNT=ACCOUNT2)
*IS 7
*REC(EXPRESSION=(%VALUE%+GET(TIME=PRIOR(1))+GET(TIME=PRIOR(2))+GET(TIME=PRIOR(3))+GET(TIME=PRIOR(4))+GET(TIME=PRIOR(5))+GET(TIME=PRIOR(6)))/7,ACCOUNT=ACCOUNT2)
*IS 8
*REC(EXPRESSION=(%VALUE%+GET(TIME=PRIOR(1))+GET(TIME=PRIOR(2))+GET(TIME=PRIOR(3))+GET(TIME=PRIOR(4))+GET(TIME=PRIOR(5))+GET(TIME=PRIOR(6))+GET(TIME=PRIOR(7)))/8,ACCOUNT=ACCOUNT2)
*IS 9
*REC(EXPRESSION=(%VALUE%+GET(TIME=PRIOR(1))+GET(TIME=PRIOR(2))+GET(TIME=PRIOR(3))+GET(TIME=PRIOR(4))+GET(TIME=PRIOR(5))+GET(TIME=PRIOR(6))+GET(TIME=PRIOR(7))+GET(TIME=PRIOR(8)))/9,ACCOUNT=ACCOUNT2)
*IS 10
*REC(EXPRESSION=(%VALUE%+GET(TIME=PRIOR(1))+GET(TIME=PRIOR(2))+GET(TIME=PRIOR(3))+GET(TIME=PRIOR(4))+GET(TIME=PRIOR(5))+GET(TIME=PRIOR(6))+GET(TIME=PRIOR(7))+GET(TIME=PRIOR(8))+GET(TIME=PRIOR(9)))/10,ACCOUNT=ACCOUNT2)
*IS 11
*REC(EXPRESSION=(%VALUE%+GET(TIME=PRIOR(1))+GET(TIME=PRIOR(2))+GET(TIME=PRIOR(3))+GET(TIME=PRIOR(4))+GET(TIME=PRIOR(5))+GET(TIME=PRIOR(6))+GET(TIME=PRIOR(7))+GET(TIME=PRIOR(8))+GET(TIME=PRIOR(9))+GET(TIME=PRIOR(10)))/11,ACCOUNT=ACCOUNT2)
*IS 12
*REC(EXPRESSION=(%VALUE%+GET(TIME=PRIOR(1))+GET(TIME=PRIOR(2))+GET(TIME=PRIOR(3))+GET(TIME=PRIOR(4))+GET(TIME=PRIOR(5))+GET(TIME=PRIOR(6))+GET(TIME=PRIOR(7))+GET(TIME=PRIOR(8))+GET(TIME=PRIOR(9))+GET(TIME=PRIOR(10))+GET(TIME=PRIOR(11)))/12,ACCOUNT=ACCOUNT2)
*ENDWHEN
This works fine for months 1 to 11 but in month 12 I get a zero on ACCOUNT2. If I replace the *REC for month 12 with this one
*REC(EXPRESSION=(%VALUE%+GET(TIME=PRIOR(2))+GET(TIME=PRIOR(3))+GET(TIME=PRIOR(4))+GET(TIME=PRIOR(5))+GET(TIME=PRIOR(6))+GET(TIME=PRIOR(7))+GET(TIME=PRIOR(8))+GET(TIME=PRIOR(9))+GET(TIME=PRIOR(10))+GET(TIME=PRIOR(11)))/12,ACCOUNT=ACCOUNT2)
I have taken out on of the +GET() parts (it doesn't actually matter which one, taking out the PRRIO(1) is just an example) the script will calculate the correct value based on the +GET() still in the script.
So to me it seems the *REC is too long. Am I correct with that assumption or have I made some other mistake?
Thanks,
Arnold

Hi Arnold,
I would suggest you to do the following:
1. Scope your script logic to YTD measure
2. Just divide the YTD value by the monthnum of the period.
Hope this helps.

Similar Messages

  • My book will not up load when I try to buy it. Can the book be too long?

    my book will not up load when I try to buy it. Can the book be too long?

    While in Safe Mode made a PDF file of the book as described in this Apple document,. iPhoto '11: Preview a book, card, or calendar before you order or print it, and check it for any errors before you place the order. Keep it to compare with the printed book when it arrives.
    OT

  • Can't publish-project too long

    I will give more background later, but to put my issue shortly, I will give the following info:
    I have one video clip that I have trimmed (by taking a bit from the beginning and a bit from the end).  It is almost 2 hours long (1:56 to be exact).
    So, I have one clip in the project and no music.  A pretty simple project.  I say share with iDVD.  It says it will take about 2 hours or so... and it seems to be going through all the appropriate processing, then, as it approaches the end of the process, it pops up with an error message from iMovie:
    Unable to prepare project for publishing.
    The project could not be prepared for publishing because an error occurred. (Project is too long.)
    (I'd give the little illustration, but whenever I bring up "Grab", it hides the pop-up error.  Once I click on iMovie, the pop-up error returns.  Weird!-- But this is a moot point as this isn't the problem- I need to publish my project to iDVD.)
    Other facts:
    I have 11.4 GB available on my hard drive, so this is not the issue.  (I had cleared up space thinking that was the problem as this is the second or third time I've attempted)
    The original movie file that is in the project is about 2.29 GB in size.
    Oddly, it seems that an error pops up under my Aperture saying I don't have sufficient space for the library volume.  I was doing nothing on the MacBook while this project was publishing, so not sure why that is coming up... and not sure why it would say there isn't sufficient space for the library if I have tons of space on my hard drive.  And, why is it popping up each time I try to publish my iMovie project?  There aren't any photos from Aperture even in the project.
    This mp4 file that I am using is actually a file produced by Elgato Video Capture (This is a VHS to digital transfer), if this matters at all.
    Previously, I had imported some jpegs into iPhoto, (for another iMovie project that I needed photos for), but iMovie could not "see" them even though they were there plain as day.  So, I imported into Aperture those same photos, and iMovie was able to "see" those in Aperture (these 11 photos are all I have in Aperture as I have not ventured into Aperture much yet-- but needed a work around for some reason on this OTHER project).  I give this info in the instance that this Aperture to iMovie link could be causing any issue with this project despite no photos being included in this project.

    Even though it might seem like a lot of space those 11.4GB of space, you still might need a little more especially as iDVD can only just about handle 2hr. worth of video material to fit on one DVD-R. The target free space you might want to get closer to is something like 25GB of open free space (almost double what you have free now). Partially the reason is all that 2 hours needs to be converted from the format it's in now Apple Intermediate Codec (AIC) to full MPEG-2. That's where things really start to expand and inflate. Then iDVD takes that whole MPEG-2 encoded file and makes an equally large Disk Image out of it that can then be burned to DVD-R. So the space requirements balloon up very quickly.
    Sharing directly to iDVD can be full of surprises. Instead what you might want to try rather than Sharing to DVD is instead sharing it to the Media Browser from iMovie first (Large Size). Quit iMovie wants it completes the encoding. Open iDVD, go to the Media button down in the lower right hand corner of the Window and at the top of the Media Browser choose Movies. In the window you should see an iMovie Star icon with the project you shared immediately beneath that. Create a new project and drag that shared iMovie into the project window.

  • Just downloaded the latest version of iTunes.  Can't find "Power Search" anymore to locate specific songs or artists?  Using "Browse" takes waaay too long.  Any suggestions?

    Just downloaded the latest version of iTunes, but can't find "Power Search" anymore to locate specific songs or artists quickly?  "Browse" takes waaay too long.  Any suggestions?

    http://www.apple.com/feedback/kaywerty wrote:
    A rather long winded way of asking if anybody knows if it's possible to have multi-windows open
    It's not possible.
    Suggestions here -> Apple Product feedback

  • Trying to restore a lost Thunderbird profile, but can't "move profile" because filenames are too long

    I'm having a problem with Thunderbird that is addressed in several postings here and on "mozillaZine," but in trying to follow the instructions given for fixing it, I have run into a new problem that I don't see addressed. The original problem is the one described in this thread, where my folders and everything have just vanished, and I'm prompted on startup to create a whole new profile:
    https://support.mozilla.org/en-US/questions/1040003
    Following the links in that thread, I get to this -- and since my address book has also apparently disappeared, I click the internal link to the section headed "Lost Profile":
    http://kb.mozillazine.org/Recovering_a_profile_that_suddenly_disappeared
    Step 1 then sends me here:
    http://kb.mozillazine.org/Moving_your_profile_folder_-_Thunderbird
    Step 2 on that page says, "Copy the profile folder to where you want to store it." When I try to do that, though (using Windows Explorer on Windows 7), it gets partway through the copying and then hangs up because it runs into a filename that is too long to copy. And according to the prompt that tells me this, there are many more such long filenames still to come.
    Do I ignore this error and just skip those files? That means the profile copy won't be complete, which I would think would be dangerous and/or would just cause further errors. Or is there some simpler way altogether to do what I originally set out to do, which is recover the profile that just mysteriously disappeared?
    Again, I'm running Thunderbird on Windows 7, and had been using it for years without ever before encountering this extremely irritating glitch. I'll be grateful for any help.

    I very much appreciate both these answers and will save them for future reference if needed. The problem seems to be resolved, although not for any reason I can explain. What happened was that I suddenly had three problems all in the same 24 hours or so: a very slow, almost unusable internet (I thought connected with my "IPv6 Connectivity"), then the Thunderbird crash, then Google Chrome not starting. Whether and how these are all related, I don't know. Anyway, while I was sitting here unable to get e-mail or get back into this forum, I decided to try a System Restore just for the heck of it, even though someone else had reported this not working. And it too seemed to fail, at first, giving me an error message that said the system couldn't be restored due to an "unknown error." But clearly at least part of it worked, because I am seeing some earlier settings, and Thunderbird then started -- almost normally, except for needing my passwords entered again.
    So I'm running "MozBackup" now in hopes of having the profile readily available next time this problem comes up. Also, Chrome is now working again after I did something or other with the security settings, and the internet seems normal even though my IPv6 status still shows "No network access." I really don't know what's been going on, but for whatever reason everything seems fixed. For now. :-S
    Again, I'm sincerely grateful for your efforts to help me. Now that I'm a member of the forum I'll try to do the same for someone else.

  • Is there a way to change the master text length in FCP? The default length is 10 seconds, which is too long. I can easily adjust the length but I don't want to do it each time, and I don't want to adjust one and then have to copy and paste this length.

    Is there a way to change the master text length in FCP? The default length is 10 seconds, which is too long. I can easily adjust the length but I don't want to do it each time, and I don't want to adjust a text clip and then have to copy and paste this each time. Ideally, there should be something in User Preferences but there is not. Thanks.

    Maybe some one else can pipe up with a solution, but this would literally take 2 seconds to do for a new project.  And you can create a "template project" that includes this "text" clip.  Save this project and then to a get info and check "stationary pad."  When you double click on this file, fcp will open with a copy of this project and you just need to do a save as. 
    I've been working with computer editing systems for longer than i can remember and at a certain point you just have to adapt your workflow to the limitations of the software.  

  • I am using itunes 10 and trying to consolidate my files.  I keep getting the error "Copying files failed.  The file name was invalid or too long".  How can I indentify what file is causing this problem or resolve this issue?

    I am using itunes 10 and trying to consolidate my files.  I keep getting the error "Copying files failed.  The file name was invalid or too long".  How can I indentify what file is causing this problem or resolve this issue?

    BUMP
    Yes, I just get that message. I don't see how I could investigate this problem.
    I didn't mention that this happened when I was consolidating my library, not copying files to another computer.
    In other words, I'm using a "normal" itunes procedure, itunes won't complete it, and won't tell me exactly why or how to figure out how to fix it...
    Is there at least some easy way to tell which files were successfully copied to my itunes music folder so I can work on moving the uncopied files?
    Can anybody help me?

  • I recently updated my iPad to iOS 8 and still checking on the settings. When I happened to swipe on my screen fro too long, it zoomed and I can no longer see what's on it. I can not even unlock it. What shall I do?

    I recently updated my iPad to iOS 8 and still checking on the settings. When I happened to swipe on my screen for too long, it zoomed and I can no longer see what's on it. I can not even unlock it. I can not use my iPad anymore. What shall I do?

    Try double tapping with three fingers and see if that reduces the screen image. If it does, unlock the iPad and go to Settings>General>Accessibility>zoom>Off. If double tapping with three fingers doesn't work, try triple tapping the home button instead.

  • Can't access files with names too long

    I have some files on a Windows formatted external hard drive that have filenames that seem to be too long for OS X to handle. I can't open them, nor can I delete them. I can't even seem to "rm" them from the command line. I know they're there, and not just some bitwise mirage. Does anyone have any way to deal with these files (they're 0 bytes long, as far as the Finder is concerned, and if you click on them, they disappear)?

    MacOS X supports file names of 256 characters (or is it 255?). Are your files names longer then that? If not, then I would suspect the problem is somewhere else, probably permissions.
    When you try to rm the file, does it produce an error? If so, what is it?

  • Can't copy files to AirDisk. Says filenames are too long

    I plugged a USB drive into my Time Capsule, that I previously had plugged into my Mac via the USB port. Now that I've mounted it as an AirDisk every time I try to copy files to it I get an error message stating:
    'You cannot copy some of these items to the destination because their names are too long for the desitnation...'
    None of the files I've tried to copy over have long filenames. In fact just to test it I created a text file & saved it with only 2 letters as the filename, & still get the same problem trying to copy to the AirDisk.
    Can anyone help?

    Yes, it's formatted as HFS+.
    Just to make sure, I've unplugged it from the Time Capsule & plugged it into the USB port of my Mac again & it works fine like this. But now I've plugged it back into the Time Capsule it's now working fine. Strange.
    Thanks for the suggestion
    Message was edited by: JonoH

  • I was backing up my iphone by changing the location of library beacause i don't have enough space.My phone was taking too long to copying file so i can celled it.the data is stored in desired location . And now i can't delete that back up

    I was backing up my iphone by changing the location of library because i don't have enough space.My phone was taking too long to copying file so i can celled it.the data is stored in desired location . And now i can't delete that back up.
    Also tell me about the performance of iphone 4 with ios 7.1.1...........
    T0X1C

    rabidrabbit wrote:
    Can I back up my iPhone 4S to my ipad 3 (64 gb)?
    no
    rabidrabbit wrote:
    However, now I don't have enough space in iCloud to backup either device. Why not?
    iCloud only give so much space for free storage, then if you exceed the limit of 5gb you have to pay for additional storage.

  • How can I download a 18 minute video I recorded from my iPad to either email or youtube or vimeo I keep getting the message the file is too long.

    How can I transfer a 18 minute video I recorded on my iPad camera app to email/youtube or vimeo? I keep getting the message the file is too long do want to send clips?
    Thanks

    Youtube usually had an 8 minute length cap, which may be part of your issue. Also at 18 minutes that is probably a gig+ file size, which will also take a long time to upload and may be another part of the issue.
    Edit it down as jim suggested. Or you may need to use something like dropbox, to get it off your ipad and onto a computer where might have more options to edit it down or size it down.
    If it's just file size you can transcode it into a smaller file - a lower quality MP4 for example. If it's the length that's an issue for youtube, you'll need to break it up into a couple different files and upload part 1 and part 2

  • I tried to send a mail message to too many addees. when the rejection came back "cannot send message using the server..." the window is too long to be able to see the choices at the bottom of it. how can i see the choices at the bottom of that window?

    I tried to send a mail message to too many addees. when the rejection came back "cannot send message using the server..." the window is too long to be able to see the choices at the bottom of it. how can I see the choices at the bottom of that window?

    I tried to send it through gmail and the acct is  a POP acct
    I'm not concerned about sending to the long address list. I just can't get the email and window that says "cannot send emai using the server..." to go away. The default must be "retry", because although I cannot see the choices at the bottom of the window if I hit return it trys again... and then of course comes back with the very long pop up window that I cannot see the bottom of so I can tell it to quit trying...

  • I have the converter to change pdf to word. Works sometime, other time says conversion is taking too long. Can I get what it has translated so I can use the parts?

    I have the converter to change pdf to word. Works sometime, other time says conversion is taking too long. Can I get what it has translated so I can use the parts?

    I would ask in the ExportPDF forum, Adobe ExportPDF (read only) (assuming that's the service to which you have subscribed). This is the Reader one.

  • I am trying to use my IPAD to video students in my conducting class, then email them the video for self evaluation.  However, many of the video clips are too long to email.  Is there anyway to compress the video clips and still email them so they can view

    I am trying to use my IPAD to video students in my conducting class, then email them the video for self evaluation.  However, many of the clips are too long to send.  Is there a way I can compress the clips and still send them via email so they can open and them using Quicken?
    Muzakmn

    It depends on the clips' content, their current format, and how much you would need to compress them, but in most cases and with most email systems, it's difficult to impossible to compress a clip enough to be able to get it through the attachment size limits of most email providers and still have the video be comprehensible. You'll probably need to find a web site or other method where you could post the videos for download by the students.
    You can try compression and trimming, though, and see if you can get the video small enough to email. An attachment often has to be 3MB or less to go through, though it depends entirely on the email systems on both ends. If you look to the right under "more like this" you'll find similar threads on the subject.
    Regards.

Maybe you are looking for