Most visited supermarket

Hi, I’d like to calculate for customer which is the most visited supermarket . I tried counting payments and max function but nesting functions are not allowed, of course, I could do with filters and ordering, but after this calculation I’d like to create a table with customer and most visited supermarket

Thanks

You can use this:

ifelse( countOver({payment}, [{customer},{supermarket}],PRE_AGG) = maxOver( countOver({payment}, [{customer},{supermarket}], PRE_AGG) ,[{customer}],PRE_AGG), {supermarket}, NULL)

And add this and {customer} as a row to a pivot table. Then apply a filter to the calculated field like this:

image

to exclude null values.

Results:

image

1 Like