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


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:


to exclude null values.



1 Like