Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
gal_polak
Creator
Creator

Comparing aggr timestamp to timestamp not working

Hi , 

I have a dimension "EventTime" which is timestamp dimension, 

and for each User, Activity combination I'm able to get the last timestamp value with the 

aggr(max(num(EventTime)),Activity,User)

 

but when i try to compare it with simple if to to the EventTime dimension in-order to  create indication that that was the "last attempt" i always get wrong answer

my if is: 

if(
   aggr(max(num(EventTime)),Activity,User) = num(EventTime)
   , 'Last attempt','Other'
)

 

this is my table:

gal_polak_0-1596720735561.png

 

Labels (1)
1 Solution

Accepted Solutions
fosuzuki
Partner - Specialist III
Partner - Specialist III

Hi,

This expression should work:

=If(max(total<User,Activity> EventTime) = EventTime, 'Last attempt', 'Other')

View solution in original post

4 Replies
marcus_sommer

In regard to your screenshot it seems that you didn't need the aggr() and the query of:

EventTime = max(EventTime)

should be working. If the structure is really a bit more complex you will probably need to do the comparing within the aggr() like:

if(
   aggr(max(EventTime) = EventTime,Activity,User)
   , 'Last attempt','Other'
)


- Marcus

fosuzuki
Partner - Specialist III
Partner - Specialist III

Hi,

This expression should work:

=If(max(total<User,Activity> EventTime) = EventTime, 'Last attempt', 'Other')

gal_polak
Creator
Creator
Author

Thank you for assiting, 

so the Max(EventTime) = EventTime 

always return true. because each row is the Max of itself. so this didn't help.

 

the code you wrote is new to me, but unfortunately didn't solve the problem. 

thank you any way 🙂  

gal_polak
Creator
Creator
Author

Amazing this solved it.

 

If it's not to much, can you explain a little bit on this convention of total with the dimensions? 
total<User,Activity> EventTime)