Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

scrollbar

Relations

Input
  • inputVariableDefinition ( 1 or more input time series)

...

The MergeRelations transformation merges input data that is defined using one or more configured relations. Each relation contains a period for which it is valid and a free format expression that is used to determine the output value for that relation. If for a given time step the first relation produces a missing value, then the next relation is used. If that also produces a missing value, then the next relation is used, and so on, until a non-missing output value is found. The output time series contains for each time step the configured output comment of the relation that was used to determine the value for that time step. If all relations produce a missing value for a given time step, then the output for that time step is a missing value.

Configuration example

 

Code Block
languagexml
titletestMergeRelations
<transformation id="testMergeRelations">
	<merge>
		<relations>
			<relation>
				<validPeriod>
					<season>
						<!--winter period-->
						<startMonthDay>--10-01</startMonthDay>
						<endMonthDay>--04-01</endMonthDay>
					</season>
				</validPeriod>
				<expression>Q1+Q2</expression>
				<outputComment>measurements A and B combined (winter)</outputComment>
			</relation>
			<relation>
				<validPeriod>
					<season>
						<!--summer period-->
						<startMonthDay>--04-01</startMonthDay>
						<endMonthDay>--10-01</endMonthDay>
					</season>
				</validPeriod>
				<expression>Q1+0.5*Q2</expression>
				<outputComment>measurements A and B combined (summer)</outputComment>
			</relation>
			<relation>
				<expression>2*Q1</expression>
				<outputComment>measurements A</outputComment>
			</relation>
			<relation>
				<expression>2*Q2</expression>
				<outputComment>measurements B</outputComment>
			</relation>
			<outputVariable>
				<variableId>Q3</variableId>
			</outputVariable>
		</relations>
	</merge>
</transformation>

 

 <transformation id="testMergeRelations"> <merge> <relations> <relation> <validPeriod> <season> <startMonthDay>--10-01</startMonthDay> <endMonthDay>--04-01</endMonthDay> </season> </validPeriod> <expression>Q1+Q2</expression> <outputComment>measurements A and B combined (winter)</outputComment> </relation> <relation> <validPeriod> <season> <startMonthDay>--04-01</startMonthDay> <endMonthDay>--10-01</endMonthDay> </season> </validPeriod> <expression>Q1+0.5*Q2</expression> <outputComment>measurements A and B combined (summer)</outputComment> </relation> <relation> <expression>2*Q1</expression> <outputComment>measurements A</outputComment> </relation> <relation> <expression>2*Q2</expression> <outputComment>measurements B</outputComment> </relation> <outputVariable> <variableId>Q3</variableId> </outputVariable> </relations> </merge> </transformation>