2 Replies Latest reply on Jan 14, 2016 9:59 AM by nigora.sharipova

# LAST() function as a filter only to one of my measures on the worksheet?

Hi,

Is it possible to apply LAST() function as a filter only to one of my measures on the worksheet?

For example, I have four metrics on my worksheet which show three weeks of data, but I would like only one of the metrics to show only one week (latest week) and the other three measures all three weeks.

Thank you,

Nigora

• ###### 1. Re: LAST() function as a filter only to one of my measures on the worksheet?

Howdy Nigora!

Are they showing three week of data in a single cell, for example an aggregate value or do you have a date field somewhere in the view.

If you have a date field in the view such that there are 4 rows (one for each measure) and 3 columns, one for each week you can do this.

IF LAST() = 0 THEN SUM(Measure) END

This will return blanks for the first two weeks and then the value for the third week

IF there are the 4 measures and only 1 column and you want 3 of these measures to use the last three weeks and 1 of these to use only the most recent week then you need to do this.

IF DATETRUNC('week',{INCLUDE : MAX([Order Date])}) = DATETRUNC('week',[Order Date]) THEN [Value] END

This will return a value in the same cell like all the others but will only use data from the most recent week.

Cheers!

Carl Slifer

InterWorks

1 of 1 people found this helpful
• ###### 2. Re: LAST() function as a filter only to one of my measures on the worksheet?

I used the first calculation and it worked for me!

Thanks so much Carl!

Nigora