Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Color Mix Not updating background colors

Hello,

Can someone tell me what is wrong with this code?  I'm trying to create background colors (mimic Excel) over a range of values (Ratio).  I would like to set it up so

Upper is Max(Ratio)

Lower is Min(Ratio)

Intermediate is in between Upper and Lower

My code isn't working and I don't understand why.

I have attached an example.

Appreciate some help, please!

12 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

Hi

You need to use Aggr() to nest the Avg inside a Min or Max:

=Max(Aggr(Avg({<DateComp={'Post'},[Exchanged]={'N'}>}[Amount]) / Avg({<DateComp={'Prior'},[Exchanged]={'N'}>}[Amount]), Other))

=Min(Aggr(Avg({<DateComp={'Post'},[Exchanged]={'N'}>}[Amount]) / Avg({<DateComp={'Prior'},[Exchanged]={'N'}>}[Amount]), Other))

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable
Author

Hello

Thanks for the help.  I was able to get it working by using

RangeMin (top(total Avg({<DateComp={'Post'},[Exchanged]={'N'}>}[Amount]) / Avg({<DateComp={'Prior'},[Exchanged]={'N'}>}[Amount]) ,1,NoOfRows(total)))

RangeMax (top(total Avg({<DateComp={'Post'},[Exchanged]={'N'}>}[Amount]) / Avg({<DateComp={'Prior'},[Exchanged]={'N'}>}[Amount]) ,1,NoOfRows(total)))

RangeAvg (top(total Avg({<DateComp={'Post'},[Exchanged]={'N'}>}[Amount]) / Avg({<DateComp={'Prior'},[Exchanged]={'N'}>}[Amount]) ,1,NoOfRows(total)))

I am going to try your suggestion tomorrow!

deepakqlikview_123
Specialist
Specialist

Thanks Manish