In my dataset, there is a field which type is date with "dddd" format (Day of Week).
Can I create a scripted field in kibana which contains the value of this field but in the form of string?
For example :
The date field is Start_Date and it equals to Wednesday. How to create "Day Of Week" field (string type)
which contains exactly "Wednesday" but as a string?
So it looks like you have already formatted the Start_Date field with dddd in Kibana. Why do you need another field that contains the same value? What is your end goal here? Knowing that it might be easier to recommend the right approach.
Actually, I want to count (unique count) of an string field (for example unique count of customer or unique count of Id ) per day of week during a specific time.
And when I am using this field as "Term aggregation" for X-Axis ( because I want to visualize how many customers will be in different week days in order to compare them with each other) , and set "Order By : Unique count of customer" and also order same as below (7 days of week):
Logically this aggregation shows the first 7 days with highest amount of customer and as you can see I have more than one Wednesday (I understand completely the result).
Finally I want to have 7 bars each belongs to each day of week ( Sunday , Monday ,...) and the height of bars shows sum of customers in each week day during a specific period of time. Then I think I need to consider Start_Date as string in order to solve my problem ( I don't have any vision about any other possibilities)
I think the only way to do this is to preprocess your data before indexing. For each document, figure out the day of the week, set it as a new field in the document, and then index the document in Elasticsearch.
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.