Steps 1,2,3 work fine. Nevertheless step 4 doesn't work.
The code that i use for each step respectively is the following:
.es(index=connect-*, q='order_type:order and event_type.keyword:order').label('Orders AX'),
.es(index=connect-*, q='order_type:order and event_type.keyword:order',offset=-1w).label('1 week ago'),
.es(index=connect-*, q='order_type:order and event_type.keyword:order').subtract(.es(index=connect-*, q='order_type:order and event_type.keyword:order',offset=-1w)).label("Difference previous week"),
.es(index=connect-*, q='order_type:order and event_type.keyword:order').subtract(.es(index=connect-*, q='order_type:order and event_type.keyword:order',offset=-1w)).divide(.es(index=connect-*, q='order_type:order and event_type.keyword:order')).label('Difference with previous week in Percentage')
What shall i correct in step 4 so i can also see the difference in percentage correctly?
.es(index=connect-*, q='order_type:order and event_type.keyword:order').label('Orders AX'),
.es(index=connect-*, q='order_type:order and event_type.keyword:order',offset=-1w).label('1 week ago'),
.es(index=connect-*, q='order_type:order and event_type.keyword:order').subtract(.es(index=connect-*, q='order_type:order and event_type.keyword:order',offset=-1w)).label("Difference previous week"),
.es(index=connect-*, q='order_type:order and event_type.keyword:order').subtract(.es(index=connect-*, q='order_type:order and event_type.keyword:order',offset=-1w)).divide(.es(index=connect-*, q='order_type:order and event_type.keyword:order')).multiply(100).yaxis(units="custom::%").label('Difference with previous week in Percentage')
Unfortunately now it shows everything in percentage
.es(index=connect-*, q='order_type:order and event_type.keyword:order').subtract(.es(index=connect-*, q='order_type:order and event_type.keyword:order',offset=-1w)).divide(.es(index=connect-*, q='order_type:order and event_type.keyword:order')).multiply(100).label("Difference previous week in Percentage %")
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.