Jump to content

Filter data such as 1 Week, 2 Week and 30 days


kirpal singh manral

Recommended Posts

Hi,

I am trying to create a calculated column based on date difference comparing two dates but not getting the desired output.

I am using Date Diff function to get days(Column Name: DateDiff) and converting it to integer. Sample values are 0,1,2,3,4,8,9,10,13,87,14,17,19,89,65,55,23,30.

Then using the below expression but not getting the desired output.

-------------------------------------------------------

Expression used

-----------------------------------------------------

case

when [DateDiff] 1 Month

--------------------------------------------------

Desired output:

0,1,2,3,4 => 1 Week

0,1,2,3,48,9,10,13,14 =>2 Week

0,1,2,3,48,9,10,13,14,17,19,23,30 => 1 Month

 

Thanks in Advance.

Link to comment
Share on other sites

I would suggest using Limting Expression for dates :

https://spotfired.blogspot.com/2014/09/last-week-month-date-expressions.html

Use these or similar expresssion in a Drop Down Document Property and have your visuals Data Limting Expression set by that document property.

 

 

 

 

This Week

Week([Date]) = week(DateTimeNow()) and Year([Date]) = year(DateTimeNow())

 

 

This Week and Last Week

Week([Date]) >= week(DateTimeNow())-1

and Week([Date]) = week(DateTimeNow())-2

and Week([Date])

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...