3 Replies Latest reply on Jan 12, 2018 7:59 AM by Kelly Wu

# Percent Difference of Two Running Totals (based on a countd function)

Hello,

I want to show the difference of to cumulative lines. The lines are running totals and based on a COUNTD function.

I found a similar problem (https://community.tableau.com/thread/129498) but the difference is the COUNTD function in my data.

It would be so nice if anyone can help me - enclosed my Workbook.

Thanks an best regards,

Tina

• ###### 1. Re: Percent Difference of Two Running Totals (based on a countd function)

I used a similar approach to the link you sent with this formula & built the Viz below. Workbook attached.

Viele Grusse aus Kalifornien

(RUNNING_SUM(COUNTD(IF [Firma] = "he" THEN [Artikelnr] END)) -

RUNNING_SUM(COUNTD(IF [Firma] = "re" THEN [Artikelnr] END)))

/

RUNNING_SUM(COUNTD(IF [Firma] = "he" THEN [Artikelnr] END))

1 of 1 people found this helpful
• ###### 2. Re: Percent Difference of Two Running Totals (based on a countd function)

Hi Steve,

thank you so much!!!!

Viele Grüße aus München :-)

Tina

1 of 1 people found this helpful
• ###### 3. Re: Percent Difference of Two Running Totals (based on a countd function)

Hi guys,

I'm having similar problem where I'm trying to figure out percent difference based on cumulative total by year. I'm trying to compare last year's 1/1 vs. this year's 1/1 total cumulative counts and trying to figure out difference.

For instance, here is the distinct counts on each day.

1/1     1/2

2017     23       18

2018     25        20

I already have a graph of the cumulative counts....so 1/2 would have 41 for 2017 and 45 for 1/2....

I'm trying to display a percent difference of 2/23 and 4/41 for 1/2....but not sure how to apply on my data...here is what I tried but I got aggregation error:

(RUNNING_SUM(IF YEAR([Created Date])="2018" THEN COUNT([CaseID)END) -

RUNNING_SUM(IF YEAR([Created Date])="2017" THEN COUNT([CaseID) END))

/

RUNNING_SUM(IF YEAR([Created Date])="2017" THEN COUNT([CaseID) END)