kibana-enhanced-table icon indicating copy to clipboard operation
kibana-enhanced-table copied to clipboard

Custom column position issue when data is filtered

Open ashryverrr opened this issue 3 years ago • 4 comments

Hi Fabien,

I was using the custom column position and it works great except when you try and filter the data.

As an example if you have a table:

Jan Feb Mar Apr May Jun Computed Column
1 2 3 4 5 6 0

In this situation the "Computed Column" will have a custom column position value of 7. Now if I filter the data to exclude Jan and Feb, it will produce an error like the screenshot. Because now my index is only up to 5 and the position of value "7" doesn't exist anymore in the index since some columns have been removed.

image

Any idea if there is a workaround for this?

ashryverrr avatar Jun 09 '21 14:06 ashryverrr

I guess that you use a "Split Cols" bucket? If yes, the problem with this feature is that you don't control columns count, and so, you can get this issue. The only way I see to avoid this issue is to use a "Date Range" aggregation in your "Split Cols" bucket, to have a fixed column count. You can define these ranges:

  • now-6M/M -> now-6M/M
  • now-5M/M -> now-5M/M
  • now-4M/M -> now-4M/M
  • now-3M/M -> now-3M/M
  • now-2M/M -> now-2M/M
  • now-1M/M -> now-1M/M

fbaligand avatar Jun 10 '21 21:06 fbaligand

That said, if your need is to put computed column after all "split" columns, you just have to not set "Custom column position" setting. By default, computed columns are positioned after all "split" columns.

fbaligand avatar Jun 10 '21 21:06 fbaligand

Hi Fabien, based on your apply I take that this is working as default right?

Since the custom column position is not really expecting that there will be a change in the # of columns and it's strictly for a fixed number.

I guess the other workaround would be to replicate the original columns by using a computed column and then arrange it from there. Thanks for the answer!

ashryverrr avatar Jun 14 '21 19:06 ashryverrr

As default, one computed column is positioned as last column. you don’t answer my question: do you use a “split cols” bucket? If so, it would be surprising to set a fixed position among split columns. Up to me, it makes sense to set a fixed custom position before split columns. Or else after all columns, and so, no custom position.

fbaligand avatar Jun 14 '21 20:06 fbaligand

Given that question is answered, I close the issue.

fbaligand avatar Nov 11 '22 15:11 fbaligand