Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
brunolelli87
Creator II
Creator II

Change color if it's above the average

Hello guys

I have the following expression which gives me the chart below:

=
sum(ValorAçãoFechamentoAjustado)/
aggr(RangeSum(above(sum({<Month=, Date={'>=$(=MonthStart(Periodo, -1))<=$(=Date(Max(Periodo)))'}>} [Patrimônio Líquido]*1000/NumeroDeAções),0,90)),Periodo)

Chart.png 

How can I color this blue line in green if it's above the average and in red if it's below the average?

For your reference, the red line is the average!

 

Thanks

5 Replies
Saravanan_Desingh

Please post a sample Application.

I can guess this..

background color:
If([Column Name] > -0.75, Green(), Red())

  

brunolelli87
Creator II
Creator II
Author

Thanks for your attention...


The question is, you used 0.75 as a static number, based on what you saw at the picture, but we know that it may not be true, and the exact number is the average of the following expression:

=
sum(ValorAçãoFechamentoAjustado)/
aggr(RangeSum(above(sum({<Month=, Date={'>=$(=MonthStart(Periodo, -1))<=$(=Date(Max(Periodo)))'}>} [Patrimônio Líquido]*1000/NumeroDeAções),0,90)),Periodo)

So, my question is:
How can I calculate the average of the following expression?

Thanks
Bruno 

brunolelli87
Creator II
Creator II
Author

Any help?

 

Saravanan_Desingh

What is the Avg formula, you have used in the Chart?

brunolelli87
Creator II
Creator II
Author

This is what I'm asking for...

How can I calculate the average of the following expression:

=
sum(ValorAçãoFechamentoAjustado)/
aggr(RangeSum(above(sum({<Month=, Date={'>=$(=MonthStart(Periodo, -1))<=$(=Date(Max(Periodo)))'}>} [Patrimônio Líquido]*1000/NumeroDeAções),0,90)),Periodo)

 

Thanks