# Operator | ## Operator | |
|---|---|---|
Description | Returns the value of a particular repeat of a particular variable. | Returns the value of a particular repeat of a particular variable. |
Relationship to repeat context | Relative to the repeat context you're in. | Absolute, unaffected by the repeat context you're in. |
Parameter description | RepeatCounter expressed as a number or a string, or Relative repeat context string with each RepeatCounter in square brackets, e.g. "[1][1]" (will be the same as the full repeat context if you are not inside of a repetition). Note: If square brackets define spans, the context must be defined within a computable. | Full repeat context expressed as a list where each member of the list is the RepeatCounter starting from the highest level of repeat to the innermost repeat counter where the value is defined. For example, the full repeat context "[1][1]" translates to List( 1, 1). |
Examples of parameters for getting lists of values | List( 1, 2, 3 ) List( "[1][1]", "[1][2]", "[1][3]" ) | List( List( 1 ), List( 2 ), List( 3 ) ) List( List( 1, 1 ), List( 1, 2 ), List( 1, 3)) |
Use in Repeat context | If the repeat context is not relevant, the expression must be unrepeated as many times as the repeat context requires. Where the RepeatCounter is used as part of the relative repeat context, it has to be concatenated to be expressed in the form "[1][1]". In these scenarios, we recommend using ## instead of #. | Same as outside of repeat context |
Get a Company outside of repeat context | < Repeat 2 {Company}< Repeat 3 {Director}>>First company value: {Company # 1} | < Repeat 2 {Company}< Repeat 3 {Director}>>First company value: {Company ## List( 1 )} |
Get a Director outside of repeat context | < Repeat 2 {Company}< Repeat 3 {Director}>>First company's first director: {Director # "[1][1]"} | < Repeat 2 {Company}< Repeat 3 {Director}>>First company's first director: {Director ## List( 1, 1 )} |
Get a list of Companies outside of repeat context | < Repeat 2 {Company}< Repeat 3 {Director}>>All companies: {Company # List( 1, 2 )} | < Repeat 2 {Company}< Repeat 3 {Director}>>All companies: {Company ## List( List( 1 ),List( 2 ) )} |
Get a list of Directors outside of repeat context | < Repeat 2 {Company}< Repeat 3 {Director}>>All directors of company 1: {Director # List( "[1][1]", "[1][2]", "[1][3]" )} | < Repeat 2 {Company}< Repeat 3 {Director}>>All directors of company 1: {Director ## List( List( 1, 1 ), List( 1, 2 ), List( 1, 3 ) )} |
Get a list of Directors inside the Company repeat context | < Repeat 2 {Company}< Repeat 3 {Director}>>Directors of each company: < Repeat 2 {Director # List( 1, 2, 3 )}> | < Repeat 2 {Company}< Repeat 3 {Director}>>Directors of each company: < Repeat 2 {Director ## List( List( RepeatCounter, ToString( 1 ) ), List( RepeatCounter, ToString( 2 )), List( RepeatCounter, ToString( 3 ) ) )}>Note: All members of the list must be of the same data type. In example above, it must be either strings or integers. Putting numbers in quotation marks or turning RepeatCounter into integer would work as well. |
Refer to a Company within another repeat | < Repeat 2 {Company}< Repeat 3 {Director}>>< Repeat Shares {Unrepeated(Company # 1)}>In these scenarios, we recommend using ## instead of #. | < Repeat 2 {Company}< Repeat 3 {Director}>>< Repeat Shares {Company ## List( 1 )}> |
Refer to a Director within another repeat | < Repeat 2 {Company}< Repeat 3 {Director}>>< Repeat Shares {Unrepeated( Director # [1][1] )}>In these scenarios, we recommend using ## instead of #. | < Repeat 2 {Company}< Repeat 3 {Director}>>< Repeat Shares {Director ## List( 1, 1 )}> |
Repeat Directors of one Company in a new repeat context, using RepeatCounter | < Repeat 2 {Company}< Repeat 3 {Director}>>< Repeat 3 {Unrepeated( Director) # concatenate( "[1][",RepeatCounter, "]" )}>In these scenarios, we recommend using ## instead of #. | < Repeat 2 {Company}< Repeat 3 {Director}>>< Repeat 3 {Director ## List( ToString( 1 ), RepeatCounter )}>or < Repeat 3 {Director ## List( "1" ), RepeatCounter}>or < Repeat 3 {Director ## List( 1, ToInteger( RepeatCounter ) )}>Note: All members of the list must be of the same data type. In example above, it must be either strings or integers. |