Showing posts with label assignexpression. Show all posts
Showing posts with label assignexpression. Show all posts

Thursday, March 8, 2012

AssignExpression In For Loop Container

What I'm trying to do is take multiple "snapshots" of a membership for many months. I was trying to do this in a For Loop Container in which I added one to the month variable and subtracted one from an iteration variable each loop, unless the month variable = 13...then I would add one to the year variable, set the month variable to 1 and subtract one from the iteration variable. This, I was hoping, would allow me to initialize 24 to the iteration variable, 1 to the month variable and 2004 to the year variable, kick off the package, and get 2 years worth of "snapshots" in seperate files (one for each month). Here is the AssignExpression I thought would work:

@.Member_Month == 13 ? @.Member_Month = 1 && @.Member_Year= @.Member_Year + 1 && @.Member_Iteration = @.Member_Iteration - 1 : @.Member_Month = @.Member_Month + 1 && @.Member_Iteration = @.Member_Iteration - 1

The package states that the single "=" should be double, but I don't think that that is what I want to do (I tried doing this just to check, and it didn't like this either). I think that it is having problems with doing multiple things on both sides of the ":". What am I doing wrong?

Thanks,

Brian Layden

The AssignExpression supports only a single assignment. Can you put the logic of updating Month and Year inside the loop in a script, perhaps?