Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
My Table has Fields Name & Modified.
I'm using the below code to get the Max Date
LOAD
Max(Date#([Modified],'M/D/YYYY h:mm TT')) As MaxDate
Resident [SP_T_$(i)]
Where [Name] Like '*ServiceNow Patching Governance Report*'
;
Let vMaxDate=Peek('MaxDate');
Trace>>>vMaxDate='$(vMaxDate)';
Also I need to get the associated Name Field here. Can you help me. how to do it?
Maybe like
LOAD
FirstSortedValue([Name], -Date#([Modified],'M/D/YYYY h:mm TT') ) as MaxDateName,
Max(Date#([Modified],'M/D/YYYY h:mm TT')) As MaxDate
Resident [SP_T_$(i)]
Where [Name] Like '*ServiceNow Patching Governance Report*'
;
Let vMaxDate=Peek('MaxDate');
Let vMaxDateName = Peek('MaxDateName');
Trace>>>vMaxDate='$(vMaxDate)';
Trace>>>vMaxDateName='$(vMaxDateName)'
Not sure I understand what you are looking to do. Can you elaborate a little?
Maybe like
LOAD
FirstSortedValue([Name], -Date#([Modified],'M/D/YYYY h:mm TT') ) as MaxDateName,
Max(Date#([Modified],'M/D/YYYY h:mm TT')) As MaxDate
Resident [SP_T_$(i)]
Where [Name] Like '*ServiceNow Patching Governance Report*'
;
Let vMaxDate=Peek('MaxDate');
Let vMaxDateName = Peek('MaxDateName');
Trace>>>vMaxDate='$(vMaxDate)';
Trace>>>vMaxDateName='$(vMaxDateName)'
Hi Sunny,
My Table looks like:
Name | Modified |
ServiceNow Patching Governance Report - 2016-05-02 | 5/2/2016 10:26 AM |
ServiceNow Patching Governance Report - 2016-05-04 | 5/4/2016 6:19 AM |
ServiceNow Patching Governance Report - 2016-05-06 | 5/6/2016 10:08 AM |
ServiceNow Patching Governance Report - 2016-05-09 | 5/9/2016 8:35 AM |
ServiceNow Patching Governance Report - 2016-05-11 | 5/11/2016 8:43 AM |
I am looking for the last File from this list. Here 5/11 th File which is ServiceNow Patching Governance Report - 2016-05-11
I believe Stefan has already provided a solution
Thank you Stefan.. It worked..