- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Find Previous date range values from selected date range
Hello Guys,
I have a requirement where i need to calculate previous date range value from selected date range.
the number of days selected in the date range will be the count for previous date range sales to be calculated.
For eg: consider a table having sales data from 2018 till date.
if i select date range from 1/11/2019 to 1/15/2019 i wanted to show sales of previous date range before 1/11/2019. ie., data from 1/5/2019 to 1/10/2019 should be shown based on selected date count.
if i select the whole month(1/4/2019 to 30/4/2019), then (2/3/2019 to 31/3/2019) sales should be shown.
if 1/1/2019 to 1/25/2019 is selected then prev date values like (6/12/2018 to 31/12/2018) is shown
Thanks in Advance.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks kashap..
I got my ans after several tries..
=Sum({<date={"<=date(max(date)-count(distinct date)) >=date(min(date)-count(distinct date))"}>}value)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
try this
Sum({<[Date] ={"<$(=Date(max([Date])-(Max([Date])-Min([Date])))) >=$(=Date(min([Date])-(Max([Date])-Min([Date]))))"}>}Value)
Hope it helps
Thanks
Kashyap.R
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks kashap..
I got my ans after several tries..
=Sum({<date={"<=date(max(date)-count(distinct date)) >=date(min(date)-count(distinct date))"}>}value)