12 Replies Latest reply on Jul 2, 2018 7:15 AM by Calum Hilton-Brown

# Obsolescent Stock

Hi,

I'm trying to create some kind of graph that shows how little (or much) stock moves. The idea is that for each month it did not move then it would highlight it.

I've attached a screenshot of my Tableau table. In this example the whole of that first item number would be highlighted, as in the 12 months the stock did not move. In the third item number, it would be highlighted until period 8, as after that the stock reduces.

Here is a screen shot of how I imagine it looking like made in Excel. Periods along the top, and part numbers along the side.

Can someone help me with how I could make this in Tableau?

• ###### 1. Re: Obsolescent Stock

We Need some kind of simple example as attached workbook as Superstore data may not replicate what you have in pic. So kindly attach a simple example from fake data

Thanks

Deepak

• ###### 2. Re: Obsolescent Stock

Here is a Tableau workbook and some fake excel data. I hope you can help me!

• ###### 3. Re: Obsolescent Stock

Hi Calum,

Like the below? -

To do this, I created a table calculation and set it to colour:

This will check whether the value matches the previous value. It will return a true if it's a match, false if it's not matching, or null if it cannot return a value - in this case it would be when month = 1 as there is no previous month to compare to.

I then dragged this field into colour on the marks card, set he size to maximum and changed the marks card to square. Then I added some blank adhoc calculations to divide the cells.

Please find the attached workbook.

Thanks,

Mavis

• ###### 4. Re: Obsolescent Stock

Hi,

Something like this?

~Tushar

• ###### 5. Re: Obsolescent Stock

Yes that's more what I was after.

But could you do it so that it only does this if it's less? And then I want it to go blank for the rest of the row no matter what.

So for example:

20,20,22, 21, 20 24

I've used bold to show where it would highlight. As soon as it gets less than the previous value I want all the highlighting to stop. #

Is this possible?

• ###### 6. Re: Obsolescent Stock

Hi Tushar,

Unfortunately not. This analysis is just to show when stock has moved (or not moved at all).

Visually I want it to show which parts are fast moving and which have not moved at all.

• ###### 7. Re: Obsolescent Stock

Hi,

You can use the below formula to show the not moving parts. If you change the conditions a little bit you can even show the increments as well.

You have tweak the color coding as well a litle bit.

best of luck

• ###### 8. Re: Obsolescent Stock

Hi Kalyan,

That's great, exactly what I was after!

Is there a way I can order it so that it has the none-moving ones at the top and the fast movers at the bottom?

• ###### 9. Re: Obsolescent Stock

you mean sort the Part numbers based on the movement in the period numbers ?

• ###### 10. Re: Obsolescent Stock

Yes that's right. So I could order the part numbers from the ones that have no moved at the top to the ones that move straight away or quickly at the bottom. Basically the most colour at the top and the least at the bottom.

The other thing is that if there's no stock in the first period that it doesn't quite work.

If you look at the screenshot above then the first period is highlighted no matter what. Then the first number is blank not highlighted. How could I resolve this?

• ###### 11. Re: Obsolescent Stock

Sorry, and one last thing. It also appears to be ignoring zeros/nulls.

So here:

It should stop highlighting after 4 as the stock has dropped.

• ###### 12. Re: Obsolescent Stock

I've managed to get it ordered by creating a that adds up your 1 and 0s from the calculation (ie 11 is fast moving and 0 is none moving).

However, nothing with a null or zero in it seems to work. The calculation seems to ignore it. Even if I replace the nulls with 0s it still doesn't work? I've tried also entering the line:

IF RUNNING_SUM(ABS(LOOKUP(SUM([Quantity]),0)- LOOKUP(SUM([Quantity]),-1))) = ABS(LOOKUP(SUM([Quantity]),-1))

THEN 0

As taking away 0 by the original number would not give you 0. Still does not work.

Any chance you could help me fix it?