4 Replies Latest reply on Oct 21, 2015 1:28 AM by James Austin

# Stock total filter by time/region

Hello,

I need to be able to show a stock at different point in time (e.g. subscribers to Product X).

I have the data with the stock at different end points divided by Region. For Example:

Jan 2015 -  10,000 Subs USA

Feb 2015 -  12,000 Subs USA

Mar 2015 -   14,000 Subs USA

I also have a time filter, so when I select Jan - Mar in my time filter I want it to show TOTAL subs on March (in this case: 16,000)

and if I select February, I want it to show TOTAL subs in February (14,000)

Using Tableau SUM  and showing Jan - Mar period ADDS up Subs for Jan + Feb + Mar.

How do I get Tableau to give me the Subs for the END Month of my filter, instead of adding it all up?

Thanks everyone,

-Cameron

• ###### 1. Re: Stock total filter by time/region

Hi Cameron,

I would just use a single select filter to ensure that people ONLY pick the end point, after all the earlier data in a range is redundant.  Probably use MY(Date) on the filter shelf, show quick filter and change to single select.

Aus

InterWorks Principal Consultant

1 of 1 people found this helpful
• ###### 2. Re: Stock total filter by time/region

Unfortunately, we have a few other measures to display along with this one. Filtering would only leave subscribers

• ###### 3. Re: Stock total filter by time/region

Think I got it using this link to an extent

Paint By Numbers: Tableau Tip - The End of Time.... series based calculations

We made the index calculated field, then index match calculated field        [index]=WINDOW_MAX([index])

Then we created a new Subscriber Calculated Field like so

IF [index]=WINDOW_MAX([index])

THEN SUM([Subscribers])      //we need SUM to fix the aggregate & non aggregate arguments error

ELSE 0

END

• ###### 4. Re: Stock total filter by time/region

Hi Cameron,

My preferred approach to this would be to use the level of detail calculation INCLUDE like:

This way you don't have to have any form of date in the visual itself.  (However, if you DO want to have a date in the view you'll have to use your current approach)

Good work though.

Aus