Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all
I have a straight table i need to pull only 1 value based on max date and project. suggest me
Script used to derive the data.
Trans3:
Load
ProjectID_SYS,
[Updated On],
[Value Before Update] as N_Customer_Traction_Status
Resident [Project Metrics History]
where [Metric Name]='Customer Traction Status';
Trans4:
load
ProjectID_SYS,
if([Metric Name]='Customer Traction Status',Timestamp(Max([Updated On]),'MM/DD/YYYY hh:mm:ss TT')) as Maxmetric
Group by ProjectID_SYS,[Metric Name];
Try
[Project Metrics History]:
LOAD [Project ID] as ProjectID_SYS,
[Project Name],
trim([Metric Name]) as [Metric Name],
Date(Date#(trim([Updated On]),'MMM DD, YYYY')) as [Updated On],
[Value Before Update]
FROM
[Bk1.xlsx]
(ooxml, embedded labels, table is Sheet1);
Trans3:
NoConcatenate
Load
ProjectID_SYS,
[Updated On],
[Value Before Update] as N_Customer_Traction_Status
Resident [Project Metrics History]
where [Metric Name]='Customer Traction Status';
join
load
ProjectID_SYS,
Date(Max([Updated On])) as Maxmetric
Resident [Project Metrics History]
where [Metric Name]='Customer Traction Status'
Group by ProjectID_SYS,[Metric Name];
Trans4:
NoConcatenate LOAD ProjectID_SYS,[Updated On],N_Customer_Traction_Status,Maxmetric Resident Trans3 where Maxmetric=[Updated On];
drop Table [Project Metrics History];
drop Table Trans3;
I do not have your data to test but should work
Try like
Trans4:
load
ProjectID_SYS,
if([Metric Name]='Customer Traction Status',Timestamp(Max([Updated On]),'MM/DD/YYYY hh:mm:ss TT')) as Maxmetric
Resident [Project Metrics History]
where [Metric Name]='Customer Traction Status'
Group by ProjectID_SYS,[Metric Name];
Thanks pradip,
but the result is still showing 2 values .
For check the actual table before the transformation used above with Trans3 and Trans4. the date is this way below.
It is very usefull
Can you upload sample qvw ?
Please find the attachment.
try this
Trans4:
load
ProjectID_SYS,
if([Metric Name]='Customer Traction Status',Max(Timestamp#([Updated On],'MMM,DD YYYY'))) as Maxmetric
Resident [Project Metrics History]
where [Metric Name]='Customer Traction Status'
Group by ProjectID_SYS,[Metric Name];
Reload this attachment and let me know.
Vamsi,
Find the attached one, Hope this will help to you
Its not working Pradip