Pivot Table

Hello,
I am fairly new to the Elastic Stack and I was wondering whether it would be possible to create a pivot table in Kibana.

Thanks,
S.

Hi @sbottura,

Welcome to the community! Not natively, but there could be a plugin to help.

Have you had a look at the Enhanced Table plugin to see if that gives you the pivot specific capabilities that you need?

Thanks for the tip,
I tried with the Enhanced Table and I got very close to what I actually need to do.
I was able to create a table with values grouped by one specific field. However, I would like to calculate the percentage of each value based on the sum of the values that have a specific name in the description. This is a screen of the table I'm working on.

I currently used this formula "col['Tipo emissione'] == 'PREAVVISO DI FERMO' ? col('N. documenti per postalizzatore') : 0" to calculate the total of the documents for each of the "Tipo emissione", then used the formula "col('N. PREAVVISO DI FERMO')!=0 ? col['N. PREAVVISO DI FERMO']*100/total('N. PREAVVISO DI FERMO') : ''" to calculate the percentage based on that total.

However, this results in a table which is very hard to read and I was wondering whether it would be possible to have just one column for the percentage, using some sort of "where condition" to sum all the values that have the same name in the column 'Tipo emissione'.

Thanks to anyone that might be able to help,
perhaps @fbaligand
S.

Hi,

2 tips:

  • first, to return an "empty" value, I invite you to return null instead of ""
  • then, at the end, if you want to see only percentage column, you can use "Hidden columns" setting (in Options tab). The hiding effect is applied at the end, after computed columns compute. In this setting, you can indicate the hidden columns, separated by a ,. You can either reference column index (0-based) or column label.
1 Like

Thanks for the reply,
I am currently stuck with an issue I don't know how to solve. I created an Enhanced Table with the split table option, but Kibana gives me some weird results when calculating percentages and totals.


As you can see here, the first table is correct, but the second one has wrong values in the percentage column. 209.136 is not the 19,37% of 719.326 but I never changed the formula.
It seems like every table calculates the percentage on the total of the first table, but that's not what I need unfortunately.

How can I fix this?
Thanks,
S.

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