Sum of Several "Top Hit" Values in Table or as a Metric

Hello Everyone,

I have been knocking my head against the screen trying to figure this out, but the solution is being very elusive to this ES Novice.

Say my data looks something like this:
timestamp, location, number of customers in the store

3/21/2019 09:04:14.354, Paris, 45
3/21/2019 09:08:47.998, Madrid, 22
3/21/2019 09:09:01.629, London, 89
3/21/2019 10:02:51.891, Paris, 23
3/21/2019 10:07:11.142, London, 32

This is getting updated all the time from a number of different locations.

What I am trying to do is to take the last value (Top Hit, size 1) from each store and put that in a table. (Did that...and it works great)

But I also want to Sum those top hits either at the bottom of the table, or as a single metric for use in a dashboard.

It seems to me like I should be able to do it, but for the life of me I cannot come up with the right incantation. Maybe a scripted field?

Thanks in advance...and as always: Pointers to the right place in the FM are always welcome in RTFM replies. (Where F = Frickin') :slight_smile:


@Bargs can you please grab this one?


@gehogan3 check out this other thread where I've answered a similar question, I think it should apply to your problem as well.

Yes!!! The vega script worked PERFECTLY!!!


1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.