5 Replies Latest reply on Sep 6, 2018 7:53 PM by meenu choudhary

# Difference column issue?

Hello! I hope you can help me with this problem!

I have headcount data from 2 different years compiled in one excel sheet. In tableau, I have a term column and then the headcount under those 2 separate terms. Is there any way I can make a difference column from the 2 different term counts? I think I'm having trouble because the dates are both under the same column from excel. If not, will the only way I can make it work be to separate the two dates?

I hope that makes some sense as I can't really post the data on here.

Thanks!

• ###### 1. Re: Difference column issue?

Hi,

Can you please attach some mock-up data along with expected output , it will help to understand the requirement clearly.

• ###### 2. Re: Difference column issue?

Here is what I came up with! What I'm trying to do is get a difference between the 2017 and 2018 terms, even with the data being within the same columns.  Just so you know, Term should be changed to a string and placed in the column area, then department and major go in the rows. Then drag the count measure under term to get the specific headcounts. Thats how you get the look that you see in the picture.

I hope that helps.

• ###### 3. Re: Difference column issue?

HI,

I am not sure which measure value you have on worksheet, as i am not able to get the values that are there in the picture with any of the measure present in my sheet.

But whatever i understood, i have done calculation on "Count"

1. 201809 = ZN(if [Term]=201890 then [Count] END)

2. 201709 = ZN(if [Term]=201790 then [Count] END)

3. Difference = [201809]-[201709]

• ###### 4. Re: Difference column issue?

Can you tell me how you got the 2017 and 2018 to be different sections without the term at the top? Did you do a filter?

• ###### 5. Re: Difference column issue?

Hi,

I have created two variable, have given the logic on my answer:

1. 201809 = ZN(if [Term]=201890 then [Count] END)

2. 201709 = ZN(if [Term]=201790 then [Count] END)

3. Difference = [201809]-[201709]

Once you will create these measures just drag all three to measure values, as given in the attached screen-shot.