cancel
Showing results for 
Search instead for 
Did you mean: 

Foreach

Former Member
0 Kudos

Hello,

How does foreach work?

IF i have 2 cubes, and I have this Foreach:

Foreach A,B,CubeA.

B2 = concat(B1,Z)

{KF,A1,B1,CubeA} = {KF,A1,B2, CubeB}

EndFor.

Will the Foreach which specifies only CubeA be able to read & assign value from CubeB?

Can I change the value of B2 like above? What happens if the changed B2 happen to be not found in CubeB?

What will be copied if CubeB does not have the record specified in {KF,A1,B2, CubeB} ? Will anything be copied to CubeA?

regards

Sanjay

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Sanjay,

FOREACH reads all the possible combinations from the (planning package) of the chars selected in the FOREACH statement (A,B,CubeA in your case).

Considering that answer to your questions: -

Will the Foreach which specifies only CubeA be able to read & assign value from CubeB?

- -Not sure why do you want to keep ‘Cube A’ in the FOREACH statement but if that is there then you can not read from cube B.

Can I change the value of B2 like above? What happens if the changed B2 happen to be not found in Cube B?

- I do not think you have concat function in FOX. But in case if its there you should be able to get the value of B2 (Z is some number I guess?). If B2 is not there in the cube nothing will be read.

What will be copied if CubeB does not have the record specified in {KF,A1,B2, CubeB} ? Will anything be copied to CubeA?

- Nothing gets copied over in this case.

Hope this helps.

Regards