AnsweredAssumed Answered

Split Multivalue string from iterator into separate variables

Question asked by dedge on Feb 24, 2013
Latest reply on Feb 24, 2013 by dedge
Hi there

I have a multivalue input with 3 bits of information in ModelBuilder, like so:
1.5,2012,Q100
1.7,2040,Q100
2.15,2070,Q100
etc

During each iteration, I want to split the input (1.5,2012,Q100) into 3 separate variables that can be separately used in my model.
water_level = 1.5
flood_year = 2012
flood_event = Q100

The water level variable will be used in a CON statement and the other two will construct the new file name.

newfilename = "WD_" + str(flood_year) + "_" + flood_event

I can split the input string into 3 separate variables using the code block in Calculate Value, but then how do I return the 3 separate variables for my model?

Do I really need to write a specific python script and use GetParameter & SetParameter or is there a simplier direct way in the Calculate Value tool?

Thanks in advance

Outcomes