Skip to main content

I have a table that looks like this:

 

Date                  Order Type              Sales

2/1/2012                A1                         1245.25

2/1/2012                A1                         45.25

2/1/2012                A1                         55.50   

2/1/2012                A1                         6.25   

2/1/2012                A1                         45.33 

2/1/2012                A1                         87.25   

2/1/2012                A1                         77.12   

2/1/2013                A1                         234.25

2/1/2013                A1                         11.25

2/1/2013                A1                         765.50   

2/1/2013                A1                         12.25   

2/1/2013                A1                         145.33 

2/1/2013                A1                         937.25

etc...

 

I want to add two new columns to the Tableau worksheet below.

One would be Change in dollars from 2012 to 2013 and the Second

would be Percentage Change from 2012 to 2013.  I believe this can

be done with a Calculation Fields.   But how can you sum for Order

Type and Year?  What would the calculation look like.  Hope that is

clearer than it sounds when I read it back.  Thanks

 

Percentage change - Calculation   

4 answers
  1. Feb 28, 2013, 3:45 AM

    Hello Robert,

     

    I used the following:

    Dollar difference:  sum([Sales])-lookup(sum([Sales]), -1)

    Percentage difference:  (sum([Sales])-lookup(sum([Sales]), -1))/lookup(sum([Sales]), -1)

     

    Output:

    Hello Robert, I used the following:Dollar difference: sum([Sales])-lookup(sum([Sales]), -1)Percentage difference: (sum([Sales])-lookup(sum([Sales]), -1))/lookup(sum([Sales]), -1) Output: Sample file a

     

    Sample file as attached. Hope it helps.

0/9000