10 Replies Latest reply: Sep 20, 2012 9:15 AM by whiteline _

# Limiting the date as a calculated dimension

Hi I currently have a calculated dimension which returns me all the possible issue dates.

=Date(ISSUE_DATE,'dd MM YYY')

How can I limit this to only show the last 13 ?

Can anyone help???

Thanks

• ###### Re: Limiting the date as a calculated dimension

Hi, rms,

you can use every function, p.e. Min() and Max(), AddMonths() etc. and ofcourse you can add dates:

If(Num(ISSUE_DATE)-13 <= Num(ISSUE_DATE), Date(ISSUE_DATE,'DD MM YYYY'))

Greetings from Munich

Martina

• ###### Re: Limiting the date as a calculated dimension

=If(Num(ISSUE_DATE) >= Num(Max(total ISSUE_DATE))-13, Date(ISSUE_DATE,'DD MM YYYY'))

• ###### Re: Limiting the date as a calculated dimension

Hi Guys

I have tried the expressions you suggested but still having no luck as when certain products that are selected the pivot table still displays more than 13 issue dates.

• ###### Re: Limiting the date as a calculated dimension

Could you provide a small sample (.qvw or excel input data)?

• ###### Re: Limiting the date as a calculated dimension

Hi whiteline

As its customer data I am unable to attach the app. In other charts there is the option to change the dimension limits but as this is a pivot there isn't the option to do that.

All I need to display is the 13 latest most recent 'ISSUE_DATE'

I have tried creating a variable: vMaxIssueDate = Max(date(ISSUE_DATE))-13 and using that in the expression but no luck with that either. As it just gets the date and subtracts 13 days from it not 13 whole ISSUE_DATES from the list.

• ###### Re: Limiting the date as a calculated dimension

Try this as calculated dimension:

=aggr(If(Num(ISSUE_DATE) >= Num(Max(total ISSUE_DATE))-13, Date(ISSUE_DATE,'DD MM YYYY'), null()), ISSUE_DATE)

• ###### Re: Limiting the date as a calculated dimension

I have replicated the table in another test app which i have attched. In this instance it will be the field 'Natural_Month' where I would like to limit the first 7 dates.

Hope this helps

Thanks

• ###### Re: Limiting the date as a calculated dimension

You can use this expression as calculated dimension (second):

=aggr(If(Natural_Month >= Max(total Natural_Month)-7, Natural_Month, null()), Natural_Month)

and toggle 'Supress when value is null' check box.

=sum({\$<Natural_Month={"=Natural_Month>=Max(total Natural_Month)-7"}>}Sales)

the first 7 dates

if you mean the first from the lowest one then use this:

=aggr(If(Natural_Month <= Min(total Natural_Month)+7, Natural_Month, null()), Natural_Month)

or

=sum({\$<Natural_Month={"=Natural_Month<=Max(total Natural_Month)+7"}>}Sales)

correspondingly.