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

List only last 3 dates

Hello All,

I have a requirement where I have to show only last 3 dates of a selected date. For example if I select today's date, the date of today, yesterday and the day before yesterday should be shown in the list box. I have tried using previous function but I am getting undesired results like for some dates when selected, I am getting the last 3 dates available in that field, but for some I am getting last 4 dates available. I am not sure why it is happening.  Please check the attachments for what I did until now and kindly let me know where I am doing wrong and what has to be done.

Thanks in advance.

2 Replies
marcus_sommer

What do you want to do meant that a calculated dimension needs to be created and those needs expressions with a condition wrapped in a aggr-function, for example something like this:

= aggr(

     only({< %Date = {">=$(=date(max(DateSpecial)-2, 'DD.MM.YYYY'))

                                 <=$(=date(max(DateSpecial), 'DD.MM.YYYY'))"}>} %Date),

   %Date)

whereby DateSpecial a special duplicated date-field in a data-island (loosen table) is then otherwise with only one date-field the selection and their reduced listbox-clone will be to affect eachother.

- Marcus

settu_periasamy
Master III
Master III

Hi Uday,

I think, that is because of Country,In your example, Some of the Date value (Dt2), having equal date in both Country(UK and Germany)

But some of the Date(Dt2) values having the different date. (E.g 4/7/2015). See the below screen shot.


Capture.JPG



Not sure, But I think, you need Create the Composite Key for Country&Date, if you need Last 3 Date Values.