fbaligand / kibana-enhanced-table

Kibana visualization like a Data Table, but with enhanced features like computed columns, filter bar, and “Split Cols” bucket
Apache License 2.0
305 stars 65 forks source link

Computed column to assign Rank #312

Closed PunamNaik closed 7 months ago

PunamNaik commented 1 year ago

I have a column for total no. of transactions done by customers. I need to add a column for Rank and assign rank(1,2,3,...) to these customers based on no. of transactions. How can I achieve this.

fbaligand commented 1 year ago

First, I guess that you have one row by customer, using a "Terms" bucket. So you can sort your customers bucket by "no. of transactions" metric (descending order). Then you check "Add a row number column" option. It will add head column "#" that is actually the rank.

PunamNaik commented 1 year ago

@fbaligand Thanks for replying. Yes I have a customer Id column, I missed to mention it previously, but here's how my table look like.

image

So in here if you see customer A & B both should have rank 1, as they have equal Txn count across stores. Therefore "Add row number column" option will not be useful. Pls share your input on this. Thank you again.

fbaligand commented 1 year ago

Well, to my known, you can sort lines customer id by descending Total Txn. But I have no solution to generate a Rank column as you wish.

it is possible using « # » column trick. But it works only if you have one row per customer id. That is not your case.