Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
DonutKing
Contributor II
Contributor II

Max Date if Max Date is over one month month ago

Hi all

I'm wanting to create a calculated dimension that returns data where the most recent submitted date in a field is over a month ago.

Apologies in advance, as I realise that this is very basic, but I'm struggling to get the data I'm expecting to see

4 Replies
Vegar
MVP
MVP

I did not completely understand, please elaborate. Maybe you could give us an example with input and desired output?

/Vegar

DonutKing
Contributor II
Contributor II
Author

Thanks Vegar

I have list of user inputted dates that reflect the date a task was completed. Ideally there would be task completed in every month, but this doesn't always occur.

I’m trying to restrict the table to return only instances where, for each Case, a task hasn’t been completed within the past 31 days.

So, in the below example, only ‘Case Name -3’, ‘Case Name – 5’ and’ Case Name – 7’ should be returned if the data is being run at 28 April.

Many thanks

Case IDCase TitleSubmission DateDays from Today (28 April)
ID - 1Case Name - 110/4/20200.58
ID - 1Case Name - 130/1/20202.90
ID - 2Case Name - 230/3/20200.93
ID - 2Case Name - 231/3/20200.90
ID - 3Case Name - 328/2/20201.95
ID - 4Case Name - 431/3/20200.90
ID - 5Case Name - 531/1/20202.88
ID - 6Case Name - 630/3/20200.94
ID - 7Case Name - 74/2/20202.74

 

Vegar
MVP
MVP

Try something like this.

 

CaseData:
LOAD * Inline [
Case ID, Case Title, Submission Date, Days from Today (28 April)
ID - 1, Case Name - 1, 10/4/2020, 0.58
ID - 1, Case Name - 1, 30/1/2020, 2.90
ID - 2, Case Name - 2, 30/3/2020, 0.93
ID - 2, Case Name - 2, 31/3/2020, 0.90
ID - 3, Case Name - 3, 28/2/2020, 1.95
ID - 4, Case Name - 4, 31/3/2020, 0.90
ID - 5, Case Name - 5, 31/1/2020, 2.88
ID - 6, Case Name - 6, 30/3/2020, 0.94
ID - 7, Case Name - 7, 4/2/2020, 2.74
] ;

NotComplete:
LOAD 
	[Case ID],  
	[Not completed Case]
WHERE 
	MaxDate < AddMonths(today(),-1);
LOAD 
	[Case ID],
	[Case Title] as [Not completed Case],
	max([Submission Date]) as MaxDate
Resident CaseData
group by [Case ID],[Case Title]
;

 

DonutKing
Contributor II
Contributor II
Author

Many thanks Vegar