3 Replies Latest reply on Dec 19, 2017 12:45 AM by Norbert Maijoor

# Calculation of YTD with two dates by the selection of a parameter

I need to build an area chart (Basically 1 Date,1 Measure,1 dimension) is required . Let's say i Have 2 date fields(AAA,BBB) . When I select Parameter AAA that date related values must be displayed. Similarly If i select Parameter BBB that date related values must be displayed.

1) This is based upon YTD .

2) I need to display calendar selection for the users to select date.

Can someone please suggest the steps to create .

• ###### 1. Re: Calculation of YTD with two dates by the selection of a parameter

Hik Deepthi,

I did read your post several times but still not sure what you are aiming for but

find my approach as reference below and stored in attached workbook version 10.3 located in the original thread.

1. Define parameter P1. Date Selector based on date. Make sure Allowable values All is checked. Based on this setting a "Calendar picker" will pop-up

2. D1. Display: DATEDIFF('year',[date],[P1. Date Selector])=0 and [date]<=[P1. Date Selector]

3. Drag required objects to the indicated locations and filter D1. Display on True and show parameter control

Regards,

Norbert

• ###### 2. Re: Calculation of YTD with two dates by the selection of a parameter

Hi Norbett,

Let me explain you taking superstore example.

There are 2 date fields - Order date and Ship date.

I need to prepare an area chart( which requires a Date field(which combines both order date and ship date), 1 measure ,1 dimension). I need to prepare a parameter named - "ORDER" and "SHIPPED" . When I click on "ORDER" Parameter , that date calendar need to be displayed and then i select a date(YTD based) by which the area chart needs to be displayed and same applies to "SHIPPED" parameter  as well.

• ###### 3. Re: Calculation of YTD with two dates by the selection of a parameter

Hi Deepthi,

Find my updated approach based on your feedback as reference and stored in attached workbook version 10.3 located in the original thread

1. Define parameter:

2. D1. Ship-Order date:

if [SPIPPED or ORDER]="SHIPPED" then [Ship Date]

elseif [SPIPPED or ORDER]="ORDER" then [Order Date]

END

3. D2. Display:

datediff('year',[D1. Ship-Order date],today())=0

and [D1. Ship-Order date]<=today()

4. Drag required objects to the indicated locations, Filter D2. Display on True and  show parameter control

Regards,

Norbert