5 Replies Latest reply on Jan 16, 2017 4:43 AM by Norbert Maijoor

# Showing 2 dates in a table

Hi,

I am having a bit of trouble trying to display 2 dates in a table. I've managed to do it once, and tried to replicate it with different dates, but it hasn't worked.

I have created a parameter to select a month from a dropdown menu. Then I need a table which shows the month (Say November 2016) compared with the same month of last year (in this case November 2015). I've managed to do it with this month compared with last month (so in this example November 2016 and October 2016).

This one works:

And it gives me this result:

But this calculated field:

Gives me this result - all the way to the selected month which is November 2016

When all I wasn't is the same as the 1st table:

November 2015    November 2016

Can anyone help with this calculated field to get the values I need (without having to filter out the middle values)?

• ###### 1. Re: Showing 2 dates in a table

I'm a little confused with what you want.

• ###### 2. Re: Showing 2 dates in a table

I just want a table which takes the date selected from a parameter (Select Month) and gives that month as well as the same month from the previous year.

So the table should look like this:

The Select Month parameter in this case would have had November 2016 chosen.

• ###### 3. Re: Showing 2 dates in a table

Hi Kerry,

Find my approach as reference below and stored in attached workbook version 9.3

a. Year: mid(str([Date (Month / Year) Parameter]),1,4)

b. Month: int(mid(str([Date (Month / Year) Parameter]),6,2))

c. Date selected: date("1-"+str([Month])+"-"+[Year])

d. datediff('month',[Date],[Date selected])= 0 or datediff('month',[Date],[Date selected])=12

1 of 1 people found this helpful
• ###### 4. Re: Showing 2 dates in a table

OH MY GOODNESS IT WORKED!

Thank you so much!

If you knew how many different ways I've tried to do this, you would be amazed!

Thank you for your help, that calculated field worked perfectly!

• ###### 5. Re: Showing 2 dates in a table

Hi Kerry,

BAM!;) You are welcome:)

Thanks for the "Award". Much appreciated

Have a nice one.