I have to create a visualization that MUST only show the data/graphic if a condition is met.
More context to this question:
In Elasticsearch we have docs containing the stock information of different bicycles.
The bicycles are owned by different dealers.
Each dealer can set their own price for each bicycle.
I want a visualization that shows the average price of a bicycle model within the stock, BUT this information can only be shown if at least 5 dealers have the same bicycle model in stock.
This condition (at least 5 dealers have the same model) must be met due to a PRIVACY POLICY. So, if the condition is not met, the visualization should not show any information.
Is this possible?
If yes, could you please give me a hint.
Welcome to the community! I'm not aware of a way to hide the visualization based on a condition, but you should be able to use a condition in the visualization to filter the data:
In case the criteria is not met then 0 (or any value you put in there) will be shown.
Note that this is just a visualization trick and it is still possible to inspect the raw response from Elasticsearch which contains the average(AvgTicketPrice) value (the condition is evaluated only on the client, the server is not aware of it).
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.