4 Replies Latest reply on Dec 30, 2016 6:54 AM by Daniel du Preez

# Having an Arrow show up or down when comparing 2 columns and why is my table not behaving like it should?

Hello to Everyone in the Tableau Community today. I have seen people talk about this subject. And I've tried it myself, but think that I'm making small mistakes somewhere. Hopefully someone can help me out please. I'm using the newest version of Tableau. Tableau 10.1. The screenshot above shows the current table I'm asking about.

First of all I have 4 columns showing Quantity. The first one is the quantity from the data source. The next 3 are calculations I made to show Current month vs Previous Month vs Same time Previous year. So my first Question is why is the Table splitting the values into 2 rows?

Could it be my Calculations?

The Calculations originated from a project I'm currently busy with.

So basically at the end of the day the table should only be one row per Category and the up or down arrow should change dynamically when comparing the values to each other.

Thank you for reading my question and a Published workbook is attached.

• ###### 1. Re: Having an Arrow show up or down when comparing 2 columns and why is my table not behaving like it should?

Hi Daniel,

Find my approach as reference below and stored in attached workbook 10.1

a. QCM: if DATEDIFF('month',[Order Date],#1-12-2015#)=0  THEN [Q] END

b. QPM: IF  DATEDIFF('month',[Order Date],#1-12-2015#)=1 THEN [Q] end

c. QMPY: if DATEDIFF('month',[Order Date],#1-12-2015#)=12 THEN [Q] end

#1-12-2015# could be replaced by today() when datasets constains current year

Current vs Previous Month: IF sum([QCM]) > sum([QPM]) THEN 'Up' ELSE 'Down' END

Current vs Same Month Previous Year: IF sum([QCM]) > sum([QMPY]) THEN 'Up' ELSE 'Down' END

The individual column formatting is explained here

1 of 1 people found this helpful
• ###### 2. Re: Having an Arrow show up or down when comparing 2 columns and why is my table not behaving like it should?

Hi Norbert

This is great thank you so much.

Am busy going through it and mastering all the steps.

Your calc's were so much simpler to mine, so thank you again its been a huge help.

Daniel

• ###### 3. Re: Having an Arrow show up or down when comparing 2 columns and why is my table not behaving like it should?

Hi Daniel,

Take your time and let me know the outcome.

Glad I could help out. Thanks for the HUGE Awards!:) Much appreciated

• ###### 4. Re: Having an Arrow show up or down when comparing 2 columns and why is my table not behaving like it should?

Hi Norbert

As you can see from the result below

The outcome is a success. You might notice that my arrows are different to yours. I found that when you edit the shape, you can choose the arrow palette and at the bottom of the palette there are two arrows, red and green.

By Choosing these we then don't need to edit the colour as well in the table.

Thank you again for the help. Its exactly what I needed

Daniel