Forum Discussion

Grace_Johnson's avatar
Grace_Johnson
New Contributor
5 months ago

Troubleshooting FlipSign

Hi all,

I'm trying to build a trial balance that shows line items in their natural debit/credit balances (e.g. - revenue, liabilities, and equity showing up as negative, and all else showing up as positive to arrive at a balanced ($0) report). However, we have some contra-accounts within our Accrued Expenses roll up that should show up as debits instead of credits. The accounts all begin with JDE_1 so I thought I could use the IF statement below to change the formatting for them, but the IF doesn't change anything (everything shows up as a negative, rather than accounts beginning JDE_1 being positive). Does anyone have any ideas as to what may be going awry? This IF statement has worked in other cube views that I've built, so I'm at my wit's end as to why it wouldn't be working here!

If (RowE1MemberName StartsWith 'JDE_1') Then FlipSign = False

Else FlipSign = True

End If

  • Campbell's avatar
    Campbell
    New Contributor

    Use code in UD8 - Flips sign back to natural sign

    Example Code:

    'This calculation flips the sign back to natural sign based on the account type
      
    Dim acct As String = api.Pov.Account.Name
    Dim acctTypeName As String = api.Account.GetAccountType(api.Pov.Account.MemberId).Name
      
    If (Not acct Is Nothing) Then
            If acctTypeName.XFEqualsIgnoreCase("Liability") Or acctTypeName.XFEqualsIgnoreCase("Revenue") Then
            Return api.Data.GetDataCell("A#" + acct + ":U8#None * -1")
            Else
            Return api.Data.GetDataCell("A#" + acct + ":U8#None")
            End If
    End If
      
    Return Nothing

  • rhankey's avatar
    rhankey
    Contributor II

    Have you thought of using a dynamically computed U8#NaturalSign member.  Normally, I have the formula consider AccountType to determine if I need to flip the amount or not.  But you can also have it include any number of other conditions if you would like.