7 Replies Latest reply on Feb 9, 2016 10:57 AM by ChandraSheker A

# Calculating Orders Respective to dates

Hi Everyone.

I was struggling with how i wanted to look the data using LOD expressions.

If you see the above pic,   I wanted to See Calculation1 as Total number(ex: 2+5+26=33) of orders across every segment with respect to order date.

I want to use Order date as Relative Date filter and change it dynamically in View.

Like above view i am looking quaterly , i would like to change it to Months or weeks etc by Clicking + on the orderdate in View. and see Total orders  to segment.

Lee mw know if i made it clear.

• ###### 1. Re: Calculating Orders Respective to dates

Hi CJ KR,

This should just be a simple window sum:

Window_Sum(Countd([Order ID]))

Place this into your view and adjust the scope to Customer segment.

Steve

• ###### 2. Re: Calculating Orders Respective to dates

Thanks,

But If i use  Segment also as a Filter the calculations will be filtered among that particular segment.

I wanted to see Total order across each segment using segment as filter.

after applying filter.

i wanted to see total orders here as 8 in calculation1

thats the reason i was using LOD.

this wont work.

• ###### 3. Re: Calculating Orders Respective to dates

Thanks,

But If i use  Segment also as a Filter the calculations will be filtered among that particular segment.

I wanted to see Total order across each segment using segment as filter.

after applying filter.

i wanted to see total orders here as 8 in calculation1

thats the reason i was using LOD.

this wont work.

• ###### 4. Re: Calculating Orders Respective to dates

Aha! Therein lies the problem, you didn't fully explain what it is you are trying to do.

Returning to your original image, Central | Q1 the distinct total of Order ID = (2+5+26) 33. Am I right in thinking that you want to see the number of 33 even if you filter say Home Office (5) so in essence, you are wanting the fixed number even if you filter the source?

If this is the case, simply duplicate the source and blend only on Region and Date, then perform the CountD([Order ID]) from the secondary source this will ensure that the number is less granular and shall remain even when you filter the segment.

Steve

• ###### 5. Re: Calculating Orders Respective to dates

Thank you.

Is there anyway without duplicating the source. using LODS or some other calculations.

because in my Actual work, im working on Live and its not suggested to duplicate the sources as we have big data to pull up.

• ###### 6. Re: Calculating Orders Respective to dates

How big a data? I am using the same where needed against a 20Bn + record set with no noticeable performance problems - the workbook opens in 10 seconds but doing this increases to 12 seconds.

Do not forget that the source is just a semantic layer, you are not really duplicating sources merely executing commands against the same source; granted, Tableau is reading and pre-aggregating the source.

Have you checked the actual source-code Tableau generates when using LOD expressions?

• ###### 7. Re: Calculating Orders Respective to dates

Thank you for letting me know this, I am was thinking this might effect the performance.