Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have the data as shown above , i want to find the max timestamp related to an id and corresponding activity and evt_type.
so there would be just one row for a unique id and the related fields.
attached is the data sheet
Please help me the feedback . thanks
create a straight table.
Dimensions:
- ID
- Activity Name
- ECT_Type
Expression:
max(Timestamp)
create a straight table.
Dimensions:
- ID
- Activity Name
- ECT_Type
Expression:
max(Timestamp)
id is getting repeated , so i think this does not work for me
thats because you have two different EVT_TYPES for that ID.
May be this?
Dimension:
- ID
Expression 1 : Activity Name
FirstSortedValue( [ Activity Name], -Timestamp)
Expression 2 : EVT Type
FirstSortedValue( EVT_Type, -Timestamp)
Expression 3:
max(Timestamp)
Thats what, i only want to pick the evt for that id where max time
this just gives me nothing at all in the table
try the below script and check the details in table box
T1:
LOAD ID,
[Activity Name],
EVT_TYPE,
(TIMESTAMP) AS TIMESTAMP,
ID&TIMESTAMP AS KEY
FROM
[C:\Users\537792\Downloads\Book2.xlsx]
(ooxml, embedded labels, table is Sheet1);
D2:
LOAD
FirstSortedValue(KEY,-TIMESTAMP) AS KEY,
'Max' as flag
Resident T1
Group BY ID;
chart as straight table:
Dim as ID,activity name,evt type
exp as max({<flag={'Max'}>}TIMESTAMP)
thanks , can you help me how to get count of distinct events at max time please
Choose your dimensions:
- Activity Name
- Event Type
i think you only want one. Just Try it out.
Expression:
count(distinct if(TIMESTAMP = aggr(NODISTINCT max(TIMESTAMP), ID, [Activity Name], EVT_TYPE), ID))