14 Replies Latest reply on Nov 18, 2013 9:09 AM by Jim Lynch

# Difference between columns in the same pane

I'd like to add a calucation that will show the difference between the two bars in each pane (orange minus blue). The field is called [LEP], and the two aliases are "LEP" and "Non-LEP".

I already tried the calculation below but with no luck.

IF ATTR([LEP])="Non-LEP" THEN

LOOKUP([%_70_&_Above],0) - ZN(LOOKUP(ZN([%_70_&_Above]),-1))

END

It's possible that this formula IS correct but that I need to make an adjustment elsewhere.

Any help would be really appreciated. • ###### 1. Re: Difference between columns in the same pane

Hi Cole,

I was unable to open your workbook (if you want re-post it, saving it as a twbx file). However, this can be done by creating three separate calculations similar to the following:

LEP Calc:

if attr([LEP])='LEP' then  [%_70_&_Above] end

Non-LEP Calc

if attr([LEP])='Non-LEP' then [%_70_&_Above] end

Difference:

[LEP Calc] - [Non-LEP Calc]

Then, place these 3 calculations on the measure values card, and place Measure Values in place of [%_70_&_Above] on the rows shelf. Remove the LEP field from the Columns shelf and place Measure Names in it's place. Finally, place Measure Names on the color shelf.

Hope this helps!

-Tracy

1 of 1 people found this helpful
• ###### 2. Re: Difference between columns in the same pane

Hi Tracy,

Your calculated fields totally made sense. But I followed your instructions and no data was displayed. It just says "18 nulls" in the bottom corner.

What am I doing wrong?

P.S. I tried attaching the example file several times as .twbx and I don't know why my computer is adding the .zip. Sorry.

• ###### 3. Re: Difference between columns in the same pane

Hi Cole,

I've reattached your workbook. First, since LEP and Non-LEP were aliases, the calculations need to match the original member names, i.e. Y and N.

Next, the calculations should be set to #_70_&_Above instead of %_70_&_Above. Refer to the copies of the calculations made, the calculations have done this and then found the %_70_&_Above. Then, the LEP Diff calculation was updated to reference the copies. Hope this makes sense!

-Tracy

1 of 1 people found this helpful
• ###### 4. Re: Difference between columns in the same pane

Hi Tracy,

This is great! The only adjustment I had to make was adding the IF statement to the Number of Records portion of the LEP-Calc formula, and similarly to the Non-LEP Calc formula:

sum(IF [LEP] = 'Y'

THEN [#_70_&_Above]

END)/

sum(IF [LEP] = 'Y'

THEN [Number of Records]

END)

Thank you so much for your help!

Cole

• ###### 5. Re: Difference between columns in the same pane

Hi Tracy,

I want to calculate difference between columns in the same pane and came across your post and would appreciate if you can help me out. I am attaching the tableau worksheet along with this post. I need to have the difference between column D & C == F and then display data for: A,B,C,F. I have tried calculating the way you suggested but I get 6 nulls.

• ###### 6. Re: Difference between columns in the same pane

Hi Harsh,

I've attached the packaged workbook here. A calculated field was created for each Source_Page. Measure Names replaced Source_Page on the Columns and Colors shelves, and Measure Values was placed on the rows shelf. I hope this helps!

-Tracy

• ###### 7. Re: Difference between columns in the same pane

Hi Tracy,

Thanks so much for the quick response. Really appreciate it

I tried doing the same things that you did to one of my sheets and again got an error. Can you please have a look at the attached sheet

Thanks,

Harsh

• ###### 8. Re: Difference between columns in the same pane

Hey Tracy,

I was not taking aggredate values. It got resolved

Thanks

• ###### 9. Re: Difference between columns in the same pane

Hi Jim,

Can you post the workbook?

-Tracy

• ###### 10. Re: Re: Difference between columns in the same pane

Here you go - thanks!

• ###### 11. Re: Re: Re: Difference between columns in the same pane

Hi Jim,

To find the percent different between Fall 2013 and Fall 2014, right click on Application Count on the text shelf and select Quick Table Calculation>Percent Difference. Then, right click on it again and select Compute Using> Application Term. To get the view you want, you'll probably want to create two separate sheets and place them on a dashboard together. I've reattached the workbook here.

Hope this helps!

-Tracy

• ###### 12. Re: Difference between columns in the same pane

Thanks, Tracy!  It works   One quick calculation question.  If Fall 2013 had 0 applications and Fall 2014 5, why does not a percentage appear?

• ###### 13. Re: Difference between columns in the same pane

Sorry - workbook would not open

• ###### 14. Re: Re: Re: Difference between columns in the same pane

Sorry -- did not see the reattached sheets - thanks!