cancel
Showing results for 
Search instead for 
Did you mean: 

Help on aForeach in Selection and Foreach in Variable

Former Member
0 Kudos

Hi,

Can anyone just guide me the proper use of all three types of foeeach statements in fox with good examples.

1, Foreach in Variable.

2, Foreach in Selection.

3,Foreach in Refdata.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

1) Foreach in variable - Will be used in the case when you want the loop in your code to execute for all values of a multiple single variable. For eg - variable contains list of products. You want to execute some code of records for each product, list of which are in a variable.

2) Foreach in selection - You have a selection in filter for characteristic(s), on which you want to loop even though data doesn't exist for these combinations in the plan cube. Eg - Similar to above, list of products given in filter selection to be looped upon in FOX code.

3) Foreach in refdata - Will be used to loop on values of a characteristic in reference data read by the FOX function. For eg - your FOX function reads data from an actuals (non-transactional) cube (as reference data because filter for the function does not contains actuals infoprovider), but you want to loop on all the products present in this reference data.