Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I have data where I need to remove records that have date in the last 2 business days. Please help me with this. Attached is the sample.
Thank you!
You have data for 01/25/2016 (Mon) so do you want to see 01/25/2016 and 01/22/2016 excluded?
Try this:
=Only({<Date -= {"$(=Date(Max({<WeekDay -= {Sat, Sun}>}Date), 'MM/DD/YYYY'))", "$(=Date(Max({<WeekDay -= {Sat, Sun}>}Date, 2), 'MM/DD/YYYY'))"}>}Value)
Where WeekDay is created in the script:
LOAD *,
WeekDay(Date) as WeekDay
INLINE [
Date, Value
01/16/2016, 200
01/17/2016, 100
01/18/2016, 430
01/19/2016, 456
01/20/2016, 679
01/21/2016, 547
01/22/2016, 455
01/23/2016, 345
01/24/2016, 466
01/25/2016, 656];
This may be?
=Only({<Date = {"$(='<' & Date(Max(Date, 2)))"}>}Value)
Hi Sunny,
Thank you for your solution. Here 01/24/2016 is not a weekday and so I would need to eliminate 01/21/2016 and 01/22/2016 from the table.
You have data for 01/25/2016 (Mon) so do you want to see 01/25/2016 and 01/22/2016 excluded?
Try this:
=Only({<Date -= {"$(=Date(Max({<WeekDay -= {Sat, Sun}>}Date), 'MM/DD/YYYY'))", "$(=Date(Max({<WeekDay -= {Sat, Sun}>}Date, 2), 'MM/DD/YYYY'))"}>}Value)
Where WeekDay is created in the script:
LOAD *,
WeekDay(Date) as WeekDay
INLINE [
Date, Value
01/16/2016, 200
01/17/2016, 100
01/18/2016, 430
01/19/2016, 456
01/20/2016, 679
01/21/2016, 547
01/22/2016, 455
01/23/2016, 345
01/24/2016, 466
01/25/2016, 656];
Thank you so much!