cancel
Showing results for 
Search instead for 
Did you mean: 

Using Auxiliary KFs in Batch Jobs

Former Member
0 Kudos

Hello Folks,

I need help on using Auxiliary KF for Batch pruposes. We have a requirement where I need to perform two types of operations on a KF, and use the two resultants values in another macro. I think I can make use of two auxiliary KFs in macro, but not sure exactly how to do this.

For Example:

AUX KF1 = Mean(KFa),

AUX KF2 = STDV(KFb)

KF 3 = AUXKF1 + 1.25 * AUXKF2

KF3 is to be used in abother condition Macro.

This above macro works fine interactively since we created two KFs in the Planning book for Mean and STDV, But in batch , obviously the values dont get saved, so the resultant KF is not calculated. I am unable to have two Auxiliary rows to be used for Mean and STDV under one Macro step. Can I achive all these in a single Macro ? Should I use two Macros? Can anyone suggest athe best approach

Thanks

Roopa

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello Roopa,

you can use auxiliar Key Figures in batch jobs, provided you include both the macro which calculates the key figure and the macro which uses it once it is calulated.

Take as an example the stadard macros used in the SNP planning books (for exmaple PB "SNP94(1)") to calculate days' supply. In order to calculate days' supply, you need first to know the number of working days in each period. You calculate the number of working days in each period with the standard macro "determine Workdays", and save them into an auxiliar KF "Workdays". Then, you use this auxiliar KF in the standard macros "Days' supply".

The condition to use it in background jobs is that you have to run both macros (in the correct order) in the same batch job, in order for the auxiliar KF to be calculated in the first macro before it is used in the second.

Hope this helps.

Kind regards.

Marcos

Former Member
0 Kudos

Marcos,

Thanks for your response, but the problem in my case is, I could create the AUXKF1 and AUXKF2, but when when I try to include them under another marco step by dragging from Elements section to perform the operation KF 3 = AUXKF1 + 1.25 * AUXKF2

I dont see them in the menu. At this point, the only thing it does is lets me create a new Aux KF which is not reqiured. FYI , I have activated Macros involving AUXKF1 and AUXKF2.

Any suggestions would help.

Roopa

Former Member
0 Kudos

Hello Roopa,

Ok, in that case I think the problem is that you have to make sure that the macro does not delete auxiliary tables.

Double-click over the macro where you need to use the auxiliar key figures (the line with the traffic light), and make sure you check the flag "Do not delete auxiliar tables". Once it is checked, when you drag the auxiliar row from elements section, the option "Generate at next level" will be shown, and then you will be able to select the auxiliar KF you created in the previous macro.

Hope this resolves your issue.

Kind regards.

Marcos

Former Member
0 Kudos

Thanks a lot Marcos, both of your above replies helped me solve the problem.

Roopa

Answers (0)