Forum Discussion

Marco's avatar
Marco
Contributor II
2 years ago

Delete accounts with a value if 0 in a specific scenario

Hi Everyone.

Is there a way to delete accounts in a scenario that have a certain value, for example, 0?

  • The API call is BRApi.Finance.MemberAdmin.RemoveMember, you will find it in the api tree. If you don't know how to look for intersection values or how to create the necessary PK objects to pass, I'd suggest checking out the Financial Calculations Handbook book, or coming to a Rules class.

    I might sound patronizing, but I would also suggest you implement this as a Custom Calculate function, and take good backups before you start executing it. Having it as part of a regular Calculate would be very risky. What you are trying to achieve has the potential to be very destructive, I really would not recommend it.

  • JackLacava's avatar
    JackLacava
    Honored Contributor

    Can you delete Account members with code, if certain intersections contain zeroes? Yes.

    Can you delete Account members for some scenarios only? No, if they go they go for all Scenarios (although you can use Extended dimensions, so that certain Accounts don't show up for certain Scenario Types).

    Would you want to actually do any of this? Probably not. Among other things, it might create problems with historical data that exists for that Account, which would likely be lost. If you don't want your "empty" Accounts to show up in reports, just use the relevant suppression options; if you want to stop using a certain Account going forward, use the InUse property.

    • Marco's avatar
      Marco
      Contributor II

      Hi JackLacava, 
      How can I delete the account through the condition? I don’t know how to do it in the BR.

      • JackLacava's avatar
        JackLacava
        Honored Contributor

        The API call is BRApi.Finance.MemberAdmin.RemoveMember, you will find it in the api tree. If you don't know how to look for intersection values or how to create the necessary PK objects to pass, I'd suggest checking out the Financial Calculations Handbook book, or coming to a Rules class.

        I might sound patronizing, but I would also suggest you implement this as a Custom Calculate function, and take good backups before you start executing it. Having it as part of a regular Calculate would be very risky. What you are trying to achieve has the potential to be very destructive, I really would not recommend it.

  • chul's avatar
    chul
    Contributor III

    My first question would be how did the zeros get there? You can wrap calculate statements in RemoveZeros and they won't populate in the first place.

    To answer your question, yes, you can write a business rule to evaluate data points and depending on the value, change the value and/or cell status.