5 Replies Latest reply on Dec 12, 2016 9:33 AM by Mark Smith

# LOD Question - % of days affected

Hi

I have a problem that I am trying to solve using an LOD expression. I'm not sure it is possible without implementing some sort of ranking at data source level.

The problem is to create a flag which highlights a stock based on the lead time of 'holds'. So, if the average lead time when 50% of available days had been 'held' is > say, 100 days, then flag the stock.

I attach a sample workbook, my initial feeling is that this can't be done in tableau using and LOD expression?

Thoughts?

Thanks

Mark

• ###### 1. Re: LOD Challenge - % of days affected

Hi Mark, can we assume that [Hold Date] is densely populated, i.e. has no skips days between days?

• ###### 2. Re: LOD Challenge - % of days affected

Hi David

Basically, the number of days in the date range could be 100 days, I need to know at what point 50 of those days are put on hold and then calculate the average lead time across the contributing holds, if that makes sense.

Essentially, it is a running sum of days on hold? and when that running sum is equal ot 50 calculate the average lead time for all days where the running sum is equal to or < 50

but with an LOD...

Thanks

Mark

• ###### 3. Re: LOD Challenge - % of days affected

Thanks for the clarification. The reason I asked about the date distribution is that we can find the midpoint of the date range very easily if we can assume that the dates are sequential and densely populated. We'd just find the total number of days and add half of that to the starting date.

• ###### 4. Re: LOD Challenge - % of days affected

Thanks David, I think I have defined the problem more clearly now -  please see the updated workbook attached (v 10.0). I can get at the number of days on hold and the average lead time for those days but stuck on the % of days affected in the order they were put on hold. I want to get the final measure in an LOD so that I can make a flag, so no table calcs.

Mark

• ###### 5. Re: LOD Question - % of days affected

Hi

Wonder if anyone can help with this, I've laid out the problem as best as I can in the latest workbook. Any help much appreciated, even if it is a 'this is not possible'

Many Thanks

Mark