Solved

I’m looking for a formula that returns MAX value of a property for each user

  • 12 July 2022
  • 5 replies
  • 376 views

Hello,

 

I’m looking for a formula that returns maximum value of a property for each user. It’s something similar with this function if we have it, PROPMAX

The thread here 

doesn’t answer my question, as I want result for each user

 

Could you help please? Thank you

icon

Best answer by Tatiana 15 July 2022, 03:57

View original

5 replies

Userlevel 2
Badge +1

Hi @gggg

The PROPMAX formula is the right option to find the highest value of a specified numerical property. In order to filter those values by each user, you will need to use the 'group by' clause and select the UserID property in the upper-right 'Segmentation Module', which is where you’ll define and identify the specific subsets of users you’re interested in learning about.

The 'UserID' property needs to be properly implemented before it can be called to build any chart in Amplitude.

In case the 'UserID' is not yet implemented and doesn't have already enough information to identify each user, then I suggest a second option which is to 'group by' IP Address property (please have in mind a unique user could access your digital product from different IP Addresses and, also multiple users could use same IP Address), 

hope it helps,

Hi @Tatiana 

 

Thank you for the response! 
I am wondering how to get MAX (Version) for each User ID

I have my User ID properly set

 

Ideally these are the steps I want to take:

  1. For each User ID, define MAX(Version)
  2. From result in step 1 above, I want to do: COUNT UNIQUE(User ID) group by MAX(Version)

Could you suggest how to achieve this? Thank you in advance!

Userlevel 6
Badge +9

Thank you for helping out here @Tatiana 😃 We appreciate it! Welcome to the community! 

Userlevel 2
Badge +1

@Jeremie Gluckman  thank you for tagging me here 😊, 

@gggg , I would simplify the formulation as in the screenshot PROPMAX(A) and then using the “..grouped by” clause with the “User ID” property. 

This, will then show a chart with the highest value of the selected numerical property to the event (in this case $revenue from “Order Completed”) for each of the users identified by the “User ID” property,

if this is not the case, please let me know what event and what numerical value are you using for your analysis, 

please let me know if that helps,

Hi @Tatiana , @Jeremie Gluckman ,

 

Thank you for the prompt response! Really appreciate the help so far


Your example actually answers the 1st step of the calculation:

For each User ID, define MAX(Version)

In your example, it is “For each User ID, define MAX(Order Completed)”

 

Now for second step in the calculation which is:

From result in step 1 above, I want to do: COUNT UNIQUE(User ID) group by MAX(Version)

Using your example, how to get number of User ID, grouped by MAX(Order Completed) ?

 

Say this case, we have this data:
User ID | MAX Order Completed
UserA | 9 order
UserB | 5 order
UserC | 9 order
UserD | 6 order

I want to have chart that shows:
MAX Order Completed | Number of User
5 order | 1 user
6 order | 1 user
9 order | 2 user

 

Thank you

Reply