Bucket Script in Data table Visualization OR Option to download raw data as csv from TSVB table

Hello Team,

I have a requirement to show percentage value in a data table and send it as a report to user for the mentioned interval. In normal Data table visualization we have Formatted , CSV to export raw data from the kibana, but same thing is not there in Visual builder

I have a challenge here to use Data Table ,

I need to take sum of field1 and sum of field 2 then calculate the percentage of field1 and field2.

I am not able to achieve this in Data table visualization, but this can be done in TSVB using Bucket script , but there i don't have an option to export the data.

Can you please suggest me a better approach to my problem!!

Thanks
Ramy