9 Replies Latest reply on Sep 21, 2016 12:40 PM by Luciano Vasconcelos

# Getting LAST after filtering

For each customer I'm trying to filter to only see the row of their 10th order or if they don't have 10 orders than I'd want to see the row of their max order #.

I tried Indexing the Order #'s and filtering to show only the the top 10 and then creating a table calc to show the last row but for customer "B" I am unable to get the LAST field to show TRUE on row 10, it still wants to show Row 12 as LAST. Any help would be greatly appreciated.

Raw Data

Desired Results:

• ###### 1. Re: Getting LAST after filtering

See this one.

1 of 1 people found this helpful
• ###### 2. Re: Getting LAST after filtering

hi Cameron,

Here you go...

So I've used the following calculation, which returns 1 if your condition is met, else 0 (or sometimes NULL!)

IF {FIXED [Customer]: MAX([Order #])} < 10 THEN

IF [Order #] = {FIXED [Customer]: MAX([Order #])} THEN 1 END

ELSEIF [Order #] = 10 THEN 1

ELSE 0

END

The beauty about this is that as it's a FIXED LoD it's a real dimension and so you no longer need to have the Order and Customer in the VizLoD to get it to work!

Hopefully, you can see what the calculation is doing, but if not post back and I'll go into a bit more detail (or if I've misunderstood the request!!!).

• ###### 3. Re: Getting LAST after filtering

Nice one Luciano!...

Cameron, use Luciano's solution, they both equate to the same thing, but Luciano's is more elegant!!

• ###### 4. Re: Getting LAST after filtering

It's almost the same.

• ###### 5. Re: Getting LAST after filtering

Luciano,

I don't see any formula or attached workbook?

• ###### 6. Re: Getting LAST after filtering

You are seeing message.

You have to open the discussion to see attached.

• ###### 7. Re: Getting LAST after filtering

Did you find?

• ###### 8. Re: Getting LAST after filtering

Yes thanks!

• ###### 9. Re: Getting LAST after filtering

Cameron, if your question was solved mark one answer as correct to close discussion.

Thanks.