Qlik Community

Ask a Question

New to QlikView

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

Announcements
Qlik Highlights 2020 Giveaway! Watch, reply and have a chance to win a $200 Amazon Gift Card! Watch Video
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Need help with creating Syntax

Hello,

My name is Syed Q. I have started my carrier as a qlikview developer few months back. I have always looked up to the community if i needed any help all along. But today i need help with creating a syntax. I have searched all over the internet and in community but couldn't come up with an answer.  I am trying to put up a syntax in which

"sum({<FINAL_STATUS_CODE={A,D}>}CLAIM_CNT)/sum(CLAIM_CNT)" is my expression for Approval rate. I want to use this approval rate to create column which will have two colors that will change based on if my approval rate is greater then the expression total then red color else green.

Can someone please help me creat a syntax wit this condition.

Thanks,

Syed

sample.jpg

1 Solution

Accepted Solutions
Not applicable

Hi,

You need to write an color expression for Background Color or Text Color area under your expression (click + sign next to your expression to see available options)

Then in Color expression you need to write something like:

=if(sum({<FINAL_STATUS_CODE={A,D}>}CLAIM_CNT)/sum(CLAIM_CNT) < sum({<FINAL_STATUS_CODE={A,D}>} TOTAL CLAIM_CNT)/sum(TOTAL CLAIM_CNT), LightRed())

if you have label for your expression you can refer it (assuming Approval Rate is the label for your expression:

=if([Approval Rate] < sum({<FINAL_STATUS_CODE={A,D}>} TOTAL CLAIM_CNT)/sum(TOTAL CLAIM_CNT), LightRed())

View solution in original post

4 Replies
Not applicable

Hi,

You need to write an color expression for Background Color or Text Color area under your expression (click + sign next to your expression to see available options)

Then in Color expression you need to write something like:

=if(sum({<FINAL_STATUS_CODE={A,D}>}CLAIM_CNT)/sum(CLAIM_CNT) < sum({<FINAL_STATUS_CODE={A,D}>} TOTAL CLAIM_CNT)/sum(TOTAL CLAIM_CNT), LightRed())

if you have label for your expression you can refer it (assuming Approval Rate is the label for your expression:

=if([Approval Rate] < sum({<FINAL_STATUS_CODE={A,D}>} TOTAL CLAIM_CNT)/sum(TOTAL CLAIM_CNT), LightRed())

View solution in original post

Not applicable

Thank you very much. That Solved it.

Not applicable

Hi Ersen,

One last question. How do i exclude the total itself from coloring. i have the condition wherein if > total red else green. because i have no condition for what if = total. So it colors the total green too.

I appreciate your help.

Thank you.

Not applicable

Hi Syed,

start your coloring expression:

if (Dimensionality()=0 or SecondaryDimensionality()=0, Null(),
if(Only(Group) = 1, $(vGreen),
if(Only(Group) = 3, $(vYellow),
if(Only(Group) = 5, $(vRed), Null())))
)