2 Replies Latest reply on Oct 18, 2016 12:53 PM by Steven Soillis

# Aggregate column if last record in Measure column is zero

I'd like to create two Calculated measure columns that will sum the value of the column based on if the value of the the selected date equals zero or not.

Attached is a list of consecutive dates with values next to each date.  I would like to create the following two columns:

• Open Column - Select a specific date using a parameter and if the Acct Value on that date <> 0 then sum every value from that date back and display the total.
• Closed Column - Select a specific date using a parameter and if the Acct Value on that date = 0 then sum every value from that date back and display the total.

Examples

• Example 1 - Select 9/21/16 - Total Acct Value = 2,479 and in OPEN COLUMN only
• Example 2 - Select 10/3/16 - Total Acct Value = 6,327 and in CLOSED COLUMN only
• Example 3 - Select 10/4/16 -  Total Acct Value = 6,345 and in OPEN COLUMN only

• ###### 1. Re: Aggregate column if last record in Measure column is zero

Hi Steven,

Find my approach below and stored at Tableau Public here

a. Define "Runningtotal"

b. Define "Open Column"

c. Define "Closed Column"

Hope it helps...

• ###### 2. Re: Aggregate column if last record in Measure column is zero

Norbert,

Thanks for your information.  The issue I am having is that I will only select and show one date at a time and not list every day in the sample.  So If I select 10-3-16 I want to see the 6,327 in the Closed Column.  Is this possible to show that value if I am not showing all the previous days?