Vega-Lite / Kibana : How can I make a table that shows calculations between aggregations? - elasticsearch

I want to do a data table in kibana like the following:
see image
That means, the 2 first columns are the sum of price and quantity and the 3rd column divides both sums to get a ratio.
Also I want this to be dynamic to changes in time range.
As far as I've seen getting the ratio is not possible in kibana, but I've noticed that there is a plugin were you can create Vega-Lite graphs in kibana.
I am new both in Vega-Lite and in kibana, so is there an example of code that creates a data table?
The Vega-Lite site did not help me a lot...
Thank you!

I believe you could add a scripted field to calculate this ratio and then u can have the column you want :D
https://www.elastic.co/guide/en/kibana/current/scripted-fields.html

Related

PowerBI groupby with filters

My company has tasked with slicing the information on turnover and to create different graphs.
My source data looks like this: Relevant columns are: Voluntary/Involuntary, Termination Reason, Country, Production, and TermDateKey
I am trying to get counts using different filters on the data. I managed to get the basic monthly total using the formula:
Term Month Count = GROUPBY('Turnover Source','Turnover Source'[TermDateKey],"Turnover Total Count", COUNTX(CURRENTGROUP(),'Turnover Source'[TermDateKey]))
This gave me a new sheet with the counts for each month.
Table that shows TermDateKey on Column 1, and Counts on column 2
I am trying to add onto this table by adding counts but using different filters.
For example, I am trying to add another column that gives me the monthly count but filtered for 'Turnover Source'[Voluntary/Involuntary]=="Voluntary". Then another column for 'Turnover Source'[Voluntary/Involuntary]=="Involuntary" and so on. I have not found anywhere that shows me how to do this and when I add in the FILTER function it says that GROUPBY(...) can only work on CURRENTGROUP().
Can some one point me to a resource that will give me the solution I need? I am at a loss, thank you all.
It looks like you may not be aware that you don't have to calculate all possible groupings with DAX formulas.
The very nature of Power BI is that you use a column like "Termination Reason" on an X axis or in the legend of a visual. Any measure that you have created on values of another column, for e.g. a count of all rows, will then automatically be calculated to be grouped by the values in "Termination Reason", giving you a count of each of the values in the column.
You do NOT need DAX functions to calculate the grouping values for each measure for each column value combination.
Here is some simple sample data that has been grouped into dates and colours, one chart showing a count of each colour and one chart showing a sum of the Value column. No DAX was written for that.
If your scenario is different, please explain.

Difference between two filtered row Spotfire

I'm in problems with Spotfire. I have filtered my dataset by feature (dat_delivery) and I would like to make de difference between rows with the same dateprice. I know that spotfire have the difference aggregation method but it doesn't work. (I'm a Rookie)
Any idea?
Thanks
I agree with Mickael M. that more information is needed to get an answer to this question, but I just want to note that you said, "I have filtered my data." When you create a calculated column, Spotfire will take all of your data into account, not just the filtered data. Sometimes this is a big deal and sometimes not.
If you want to calculate only on filtered data, you will need to write an expression on the axis of a visualization, not create a calculated column.

How to display the last value in Grafana Gauge

I'm new to using Grafana and I'm trying to display the last value of a table that's organized by dates in a Gauge visualization.
All the options I'm seeing to displaying the data are grouping methods like max, average, sum and so on.
Is there a way to get only the latest most updated value from that table? And to always display it?
I'm using Grafana v7.1.3 and ES.
Choose "Last" or "Last (not null)" from the "Display" option:

Duplicate key measure columns appearing in a matrix

The requirement:
My users want a slicer which displays the dimensions of a data table they can then select from and have the dimensions display in a corresponding matrix visual along with two measures, Sales TY and Sales LY.
Progress so far.
I’ve achieved this by taking the table, selecting the column which indexes the table and unpivoting the rest of the columns. Next I place a slicer on the report and attach it to the unpivoted table’s Attributes field (now renamed as ‘Column’). Finally, I add a matrix visual to the report and add to it the unpivoted table fields Column, Index and Value fields. Now when I click on the slicer, whichever dimensions I select appear in the matrix.
The problem:
However, when adding the measures previously created (Sales TY and Sales LY) to the matrix, each measure is repeated after every column selected for display, whereas I only want the measures to display once.
Does anyone know if this possible? I’ve tried a number of approaches but nothing seems to work. I’m a new user so apologies if this is an FAQ I’ve yet to come across or I’m doing something glaringly obviously wrong. As I say I’m only just starting out in DAX and Power BI. I’m looking pretty hard at table functions and the Switch statement with the hope of calculating the solution somehow but haven’t managed it yet. Any advice, steer or comment greatly appreciated, thanks.

Comparing data in kibana

I am indexing user data for each day and using Kibana to analyse it, so far I am able to visualize all my requirement. But I am not able to visualize following use case
I want to analyse total number of user,repeated number of users from previous day and how many are unique.
I can visualize total number of user for day , but how do I compare today's data from yesterday.
Any help appreciated.
Thanks in advance
I hope I understand your requirement correctly, but you could create a Vertical Bar Chart visualization with Kibana and change the default 'Count' to 'Unique Count', select the field you like to do the unique count for and then add an X-Axis with a date histogram on your timestamp field.
This will create a bar chart and each bar will contain the unique count for each time interval. So if you select 7 days as your timeframe and 1 day interval in your X-Axis date histogram, you'll see the unique count per day.

Resources