Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Announcement: Certain actions are currently causing a Page Not Found error. This is a known issue and we are working with the platform vendor to investigate and resolve it.
Not applicable

simple if statement question from a beginner

I would like to display values in a single column of a straight table in two different colors. The column is "Margin %" and I would like to display it in red if it is under 20% and green if it is over 20%.

Unfortunately, I can't even get a simple if statement to work. It may be my syntax, as I've never done it before. Under the definition for "Text Color" in my Margin % expression, I have

IF(Sum(Margin) / Sum(Sales) <= 0.2) // that margin / sales is how i calculated the margin percent...

red();

ELSE

green();

end if



I can't even get a simple if statement to work. But that's what I need to do.

Thanks!

1 Solution

Accepted Solutions
Not applicable

simple if statement question from a beginner

Why have ELSE and end if

IF((Sum(Margin) / Sum(Sales)) <= 0.2,red(),green())

1 Reply
Not applicable

simple if statement question from a beginner

Why have ELSE and end if

IF((Sum(Margin) / Sum(Sales)) <= 0.2,red(),green())