5 Replies Latest reply on Oct 3, 2018 12:41 PM by Deepak Rai

# Proper Place for LOD Use??

I'm not sure if this is the proper place to use a LOD expression or not.  I have daily incremental data based on type and sub-type.  Based on the date range selected, I want to find the  average of the daily sums and then compare that to the actual day summed value.  The tricky part is the data is incremental so if I used Average then it gives me the average of the transactional data which isn't what I'm after at the moment.

This expression only works some of the time.  It doesn't work when (All) is selected in both Type and Subtype.

I want the TimePeriod_Avg to show 437.5 instead of the 218.8

I eventually want to show the variance from the average.

Packaged workbook should be attached; Tableau 10.5.0

Thanks,

Bernie

• ###### 1. Re: Proper Place for LOD Use??

Hi Bernie,

Here it Is. Since it is FIXED LOD, Your Filters are in CONTEXT

Thanks

Deepak

If it Helps, Pl Mark it Helpful and CORRECT to Close Thread

• ###### 2. Re: Proper Place for LOD Use??

Thanks Deepak!  Would this also work if I had two months of data and I wanted the average across the two months?  I'm thinking it would return the monthly averages and not the combined two months of data daily average.

• ###### 3. Re: Proper Place for LOD Use??

If You have 2 Months of Data and You want to get Combined Average , then do this:

{AVG(({FIXED DATEPART('month', [Date]),DATEPART('day', [Date]): SUM([Amt])}))}

Thanks

Deepak

Let me know, If it Helps and If It does, Pl mark the Reply as Helpful and CORRECT.

1 of 1 people found this helpful
• ###### 4. Re: Proper Place for LOD Use??

Thanks Deepak!! Exactly what I'm looking for!

• ###### 5. Re: Proper Place for LOD Use??