I have an index "consump" having as fields : category, timestamp, costs.
I want to display in Kibana Canvas, a bar chart exhibiting cumulative sum(costs).
In other cases I used "timelion" for that like this: "
The problem in this case is that calculating the sum(costs) is not straight forward : for example if I need to calculate the SUM(costs) of the current month I need to do such query(since it is a blended cost):
essql
query="SELECT MAX(costs)
AS costs
FROM "consump*"
WHERE MONTH("@timestamp")=MONTH(CURRENT_DATE())
GROUP BY "category""
| math "round(sum(costs),2)"
So, basically here, for example, for the category "c" : between the 1st and the 15th day, it hasn't consumed money as the costs remained at 1$. However, between the 15th and the 20th day it has consumed 1$. Same for "a" : between 1st and 15th day, it consumed 1$ and between 15th and 20th day, it consumed 4$.
I hope this makes the picture clear.
I tried to use mapColumn, but it did not work for me.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.