# New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Our May 2021 end-to-end product release from Data Integration to Data Analytics is out! READ DETAILS
cancel
Showing results for
Did you mean:
Contributor II

## Background expression in qlik sense

Hi there, first time asking a question through these forums so please excuse me if it’s in the wrong place or I have done something wrong.

I have a report with a KPI -  avg(is live), this is telling me the conversion of the overall report, did it go live yes or no.

Within this report I also have a straight table, dimension/row is dealer name, column/measure is avg(is live) – so this is telling me conversion by dealer name, did it go live with that dealer yes or no.

I currently have this expression  -  if(avg([Is Live])>=0.13, 'red', green ()) – so anything over 13% goes red but I don’t want it to be a static number, I want it to be based on another measure….. does that make sense?

I wasn’t sure if it was possible to assign a formula asking it to measure everything, in a straight table with a dimension.

I’ve tried multiple variations like this –

if(avg([Is Live])>=avg({<[Dealer Name (Dealer)]=>}[Is Live]),'red',green ())

1 Solution

Accepted Solutions
Specialist

Hi,

If you want to be above the (weighted) average of all Dealer Name (Dealer) I think you would use TOTAL rather than set analysis, so something like;

if(avg([Is Live])>=avg( TOTAL [Is Live]),'red',green ())

And you should be able to use a reference to a different field in the right hand side of the inequality also, but you will need to share some more details of your data and model.

Does that help?

Cheers,

Chris.

2 Replies
Specialist

Hi,

If you want to be above the (weighted) average of all Dealer Name (Dealer) I think you would use TOTAL rather than set analysis, so something like;

if(avg([Is Live])>=avg( TOTAL [Is Live]),'red',green ())

And you should be able to use a reference to a different field in the right hand side of the inequality also, but you will need to share some more details of your data and model.

Does that help?

Cheers,

Chris.

Contributor II
Author

Sorry for the delay in my reply but yes it worked perfectly. Thank you for your help!