Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Making chart dimensions using calendar variable

Dear Colleagues,

Id like to create a chart which dimensions are based on a calendar variable. The dimensions should show the IDs that happened from the chosen date, 30 days before the chosen date and so on..

IDDate
101/12/2017
201/11/2017
3

11/10/2017

412/09/2017

Let´s suppose that we chose the day 19/12/2017.

The dimensions should show then "19/12/2017, 19/11/2017 ... 19/12/2016" (13 dimension values).

The expression should be a simple count distinct ID.

Can someone help me out?

Thx!

6 Replies
sunny_talwar

I think all your need is set analysis in your expression

Dimension

Date

Expression

Count(DISTINCT {<Date = {"$(='>=' & Date(Max(Date) - 30, 'MM/DD/YYYY') & '<=' & Date(Max(Date), 'MM/DD/YYYY'))"}>} ID)

Also, look here

Dates in Set Analysis

Anonymous
Not applicable
Author

Sunny, how many dimensions will I have in the chart you are proposing?

Anonymous
Not applicable
Author

I mean.. how many values in the dimension axis.

sunny_talwar

It should show all available dates between max date and max date - 30

Anonymous
Not applicable
Author

Ok, as I checked.. But the aim is to create 12 dimesion values.

The first one would show values between max date and max date-30, the second one shows between max date-30 and max date -60 and so on..

sunny_talwar

Then you can either create a new dimension in the script or you can use a calculated dimension

If(Date > Max(TOTAL Date) - 30 and Date <= Max(TOTAL Date), 'max date - max date - 30',

     If(Date > Max(TOTAL Date) - 60 and Date <= Max(TOTAL Date) - 30, 'max date - 30 - max date - 60',

          and so on....