Skip to Content
author's profile photo Former Member
Former Member

APO macro as excel function =LEFT or =RIGHT

Hi all,

in demand planning process I am using a customer specific characteristic which is a string of several numbers.

By one specific digit out of this string it has to be differentiated whether calculation logic A or B has to be executed.


9 9 9 1 9 9 --> calculation A

8 8 8 1 8 8 --> calculation A

9 9 9 2 9 9 --> calculation B

8 8 8 2 8 8 --> calculation B

Is there any macro functionality like the excel function "=left" or something else which can return the value of this string's certain digit of the actual selected CVC?

By the way, I don't want to solve this by creating an additional characteristic/attribute oder changing the CVC structure...

Any help would be highly appreciated!


Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Sep 07, 2009 at 01:54 PM


    Try this:

    Suppose you are storing the valkues in Characteristic "CHARA". You want to decide upon the use of "Alternative 1"

    or "Alternative 2" based on whether the FOURTH digit in "CHARA" is "1" or "2".

    So IF:

    8 8 8 1 8 8 --> Alternative 1

    9 9 9 2 9 9 --> Alternative 2

    Use the follwoing logic:

    SET Layout Variable "VAR" = ACT_IOBJNM_VALUE("CHARA")

    IF {DIV ( FRAC( VAR/1000 ) / 100 )} = 1

    USE Alternative 1

    ELSEIF {DIV ( FRAC( VAR/1000 ) / 100 )} = 2

    USE Alternative 2

    EX: for 888188

    DIV ( FRAC( 888188/1000 ) / 100 )

    = DIV ( 188 / 100 )

    = 1

    I think this might just work. My only doubt is if the variable VAR will be treated as a char string, thus not allowing

    any arithematic manipulations...

    Let me know if this helps.



    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Abhi,

      thanks for your reply.

      After testing I can confirm that it is possible to store the numeric value of a characteristic as a number in a layoutvariable :

      Macro syntax as an example:

      action box: set LV


      Important: If you use 'ACT_IOBJNM_VALUE( 'ZZZZ' )' (->with ' ) the system can't work with this as it interprets this as a text string.

      The rest should be clear...


Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.