Skip to Content

Data Actions - summary by attributes

I would like to calculate the bellow
INC accounts
minus
EXP accounts
I don't want to chose the list of accounts - because I have too many of them and I cannot be sure that my client won't add more in the future. and I don't want to add a hierarchy for the same reason so I need to be able to group all my incomes/expenses by using a formula, in data actions Is there a way to create a parametter not in the leaf level?

Thank you!!!

Add a comment
10|10000 characters needed characters exceeded

Related questions

5 Answers

  • Posted on Jul 14, 2020 at 02:14 PM
    CONFIG.FLIPPING_SIGN_ACCORDING_ACCTYPE = ON
    //MEMBERSET -> try to add as much as possible
    
    //Variables
    VARIABLEMEMBER #TOTAL_EXP OF [d/Account]
    VARIABLEMEMBER #TOTAL_INC OF [d/Account]
    
    //Get EXP and INC IF [d/Account].[p/ACCTYPE] = "EXP" THEN DATA([d/Account] = #TOTAL_EXP) = RESUTLOOKUP([d/ProfitCenter]="PC0001") ELSEIF [d/Account].[p/ACCTYPE] = "INC" THEN DATA([d/Account] = #TOTAL_INC) = RESUTLOOKUP([d/CostCenter]="CC0001") ENDIF //WriteBack DATA([d/Account]="NetIncomeTotal",[d/ProfitCenter]="#",[d/CostCenter]="#") = RESULTLOOKUP([d/Account] = #TOTAL_EXP)+RESULTLOOKUP([d/Account] = #TOTAL_INC)
    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 14, 2020 at 09:05 AM

    This is how you can get total net income from EXP & INC accounts

    CONFIG.FLIPPING_SIGN_ACCORDING_ACCTYPE = ON
    MEMBERSET [d/Account].[p/ACCTYPE] = ("EXP","INC")
    
    VARIABLEMEMBER #TOTAL_NET_INCOME OF [d/Account]
    DATA([d/Account] = #TOTAL_NET_INCOME) = RESUTLOOKUP() //Now you want to write-back the result somewhere?
    DATA([d/Account]="EarningsCY") = RESULTLOOKUP([d/Account] = #TOTAL_NET_INCOME)
    Add a comment
    10|10000 characters needed characters exceeded

    • Vadim,

      True, but in my experience SAC can do some really weird things if not using VARIABLEMEMBER, especially if adding a little more complexity. Some of these things I couldn't get my head around, so now I use it ever since... maybe recent fixes have solved some of that, but I'd rather be sure. :)

  • Posted on Jul 14, 2020 at 10:29 AM

    Thanks Jef, I will try it :)

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 14, 2020 at 11:06 AM

    Hi Jef
    I tried it and it works using this code, however my need is a bit ,ore complex and I couldn't set it myself
    I have to summarize INC from a specific "profit center"
    and EXP from another "cost center"
    didn't find a solution yet

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 15, 2020 at 05:46 AM

    WOW!
    Thanks Jef!!
    that helps a lot, I've still a lot of complexity to figure out - but I'm definitely on a better way!
    thanks!

    Add a comment
    10|10000 characters needed characters exceeded

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.