3 Replies Latest reply on May 7, 2018 6:25 AM by David Luhut

    Get the result of LOD of SubHeader  and  assign it to the Header

    David Luhut

      Using Tableau Desktop v10.4

       

       

      Hello,

       

      I am new to Tableau so please be patient with me.

       

      I have attached a packaged workbook ( don't know if it is the correct way of doing it) where I've created a mini version with dummy data. But the problem that I'm facing is the same.

       

      What I am trying to do here is to create a P&L statement and I understand that Tableau is more of a visual tool rather than a 'text layout' purposes.

       

      Also, due to Accounting thingy, anything that's negative number is actually "good" and anything that's positive is actually "bad". And since users like to see everything in 'positive' numbers, I create a CASE statement that reverse the sign when it's 'Revenue', 'Operating Income', 'Building Income' etc, and leave the Expense side as is, reflecting the PnL Header Categories.

       

      MTD Actual:=

      CASE ATTR([PnL Header])
          WHEN "Revenue"
              THEN -SUM([MTD Local Actual])

           ELSE SUM([MTD Local Actual])

            ...

            ...

            ...

            ...

      END

       

       

       

      where,

       

      MTD Local Actual:=

      IF [Date] = DATE([UserMonth] + '/01/' + [UserYear])

      THEN

      [Local Actual]

      END

       

       

      where [Local Actual] comes from SAPBW column itself,

                [UserMonth] and [UserYear] are Parameters

       

      My problem now here is that, one of the 'PnL Header' has 'RevPAS' where it derived from taking the SUM of 'Vacancy' (from SubHeader) and  'Gross Rent' (from SubHeader) and DIVIDE it by No. of Units (using BLEND instead of JOIN). I have tried using LOD and even a simple SUM(IF()) functions. However, I always get blank result.

       

       

      Please let me know what I've done wrong.