Skip to Content
0
Jan 25, 2014 at 06:46 AM

BI-IP Fox formula issue

752 Views

Hi

I have an issue with fox formula, the scenario is below.

We have 2 Planning DSOs, DSO1 and DSO2, with Multi Provider on top and aggregation level.

DSO1 which holds data for each product, cproduct , Range from and Range to, and Deviation %.

DSO2 holds transaction and planning data for product and cproduct.

there is one KPI called Control KPI in DSO2, which is calculated for each product and Cproduct by a separate planning function.

Now Based on the control KPI value of Cproduct, i have to update Deviation %. into DSO2 from lookup by DSO1.

If only Control KPI value lies between Range from and Range to, the same Deviation %.needs to be picked and updated into DSO2.

The records will look like in both DSOs something like this.



The fox code which i have written is below.


DATA PROD TYPE ZPROD.

DATA CPROD TYPE ZCPROD.

DATA CONTROL TYPE F.

DATA SU TYPE 0SALES_UNIT.

DATA GUID TYPE ZCAN_GUID.

DATA R1 TYPE F.

DATA R2 TYPE F.

* TO be changed selections --{ Key Figure Name ZPROD,0INFOPROV,0SALES_UNIT,ZCAN_GUID,ZCPROD }

FOREACH PROD, CPROD.

R1 = {ZFRM_PER,PROD,'DSO1',#,GUID,CPROD}.

R2 = {ZTO_PER,PROD,'DSO1',#, GUID ,CPROD}.

CONTROL = {ZCONT,# , 'DSO2',SU,#,CPROD}.

IF CONTROL > R1 AND CONTROL < R2.

{ZDEVPER,#,DSO2,SU,#,CPROD} = {ZDEVPER,PROD,DSO1,#,GIUID,CPROD}.

ENDIF.

ENDFOR.



The issue here is basically three values in question , Control KPI , Range From and Range to are not read in one iteration.

They are read in three different iterations, that is when control KPI is read, then Range From and Range To is not read and vice versa, thus making comparison impossible

could anyone let me know, if any this wrong with code and suggest changes.

regards








Attachments

can1.jpg (55.4 kB)