Comparing data in kibana - elasticsearch

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.

Related

Filter a measure betweeen 2 dates

I have a line chart in which i am showing the cumulative value of the plan and actual and I have a week slicer in which I have the end of every week.
In the line chart, i would like to show the Actual until the filtered week.
I am not sure if that is possible since the slicer of week name is a specific date and not a range, can anyone help me ?
See attached files in the link below the excel file is how i want to be and the PBIX is how it is now.
https://www.dropbox.com/scl/fo/s71624sg18jccgugqikj1/h?dl=0&rlkey=4yd3leqbxjvp2kwnqqxh0gj62

Excluding a Metric from a Visualisation Filter

I am a new user to MicroStrategy Developer and am stuck with a task that I want to do. I have created a table visualisation and applied two filters to the visualisation via the visualisation filters:
Top 10 Rank by Volume Filter
A current month Filter
My table has the following table headings:
Region
Sales Person Name
Sales Volume
Average Sales Volume To Date
I want the table to display the Current Months values for the 1st three columns and then the last column to display the average sales volume to date (based on 2 years worth of data). However clearly Average Sales Volume is not working correctly, I am assuming this is due to the Month filter applied to the visualisation.
Being a new user to MicroStrategy, I am not sure how best to get round this? Is there a way of making the Average Sales Volume To Date metric independent of the Date filter applied to the visualisation? Or a better way to build this without applying visualisation filters?
Any hints or tips would be much appreciated.
Thanks!
I am not very sure whether this works out but you can give it a try.
Create the "Average Sales Volume To Date" metric as a level metric and set the filtering as Ignore.

Rank only for latest month

I've a calculated field "Total Revenue" which blends revenue from multiple data sources in Tableau.
Based on this field (aggregate field) on monthly basis, I would like to show only TOP 5 items with highest revenue as of latest month.
As shown in above table, items have to be filtered out (as they are TOP 5 in March) based on revenue data as of the latest month (March). How can this be achieved using RANK()? I'm not able to rank only for latest month as formulated below because it shows error as I cannot mix aggregate and non-aggregate functions.
IF DATETRUNC('month'),ReportDate)=//March 1st date given//
THEN RANK(Total Revenue)
END
My solution is a kind of workaround but seems to be working:
Create a calculated field with below formula:
IF DATEPART('month', {MAX([date])}) = DATEPART('month', [date])
and DATEPART('year', {MAX([date])}) = DATEPART('year', [date])
THEN
[revenue]
ELSE
0
END
The {MAX([date])} part on the code gets the maximum date in your data, it is fixed with { and } characters so that the value is not effected by the filters, date partitions etc. If you want the sorting month to be the one we are in then you should change that part with NOW()
Now we have a value containing only the sum of the latest month and we can sort our visual with this Measure.
You can drag your new measure (I called my measure: 'last month revenue') to the details and right click your item pill on the Rows, sort it by your new field.
And finally drag your item to the filters and go to Top tab, make filter your data according to sum of "last month revenue" measure.
Below screenshot shows the excel data and the final Tableau table:

Daily unique count, weekly unique count in the same Timelion chart

I want to visualize the unique count for a field aggregated daily and weekly per day in the same sheet. But timelion aggregation affects the entire sheet instead of just a single chart.
The expression I am using to get the daily unique count is
.es(metric='cardinality:userId').bars().title('Unique users over time')
If I change the bucket range on the right to 1d, I get the correct chart. How do I create the weekly aggregation?
There is a possibility to specify the interval used for timelion expressions by specifying interval as 1d or respectively 1w in the es() function. For details, please see the docs here.
In your case this should work with the following expression:
.es(metric='cardinality:userId',interval=1w).bars().title('Unique users per week')
Be aware of the comment inside the docs, stating that this should not be used in favor of working with the interval picker. But probably this is a use case where it is okay to do it like this...

Kibana subtracting the values of 2 indices

I have 2 indices in kibana 4:
1st index is basing time from events (Date Created)
2nd Index is basing time from events (Date Closed)
Both are date values and I want to create a query which will return the total amount of docs Date Created (Today) - total amount of docs Date Closed (Today)
If this is not possible is it possible if i have both fields in one index?
Yes you need to have both the date values within the same index so that you can do the subtraction using a scripted field in Kibana. You could simply have your script as such:
doc.['date_created'].value - doc.['date_closed'].value
----------------^----------------------------------------^ Make sure to give your exact field names
And then you could use this scripted field as a Date Historgram to show the total count of the docs within the retrieved date range.
Hope this helps!

Resources