# New to Qlik Sense

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

Announcements
Support Cases coming to Qlik Community Oct. 4! Start chats, open cases, explore resources: READ DETAILS
cancel
Showing results for
Did you mean:
Contributor

## Color expession on a large formula

Hi guys.

Little bit of help need as I`m a complete Qlik novice.

I`ve had to construct a column which shows an average sale % movement, I`ve created added the formula below, but was hoping i could color code the results such as: if its a loss show in red, if it`s a gain show in green or if it breaks even, show in grey.

But if i try and add in the formula to the color expression, it breaks?

((
Sum(if([Sales Invoice Date]>=[Date change in front of customer] and [Is Sales Account]='Yes',[Sales Qty]))
/
Floor(((Today()-[Date change in front of customer]))/7)
)
-
(
Sum(if([Sales Invoice Date]>Date(AddMonths([Date change in front of customer],-12)) and [Sales Invoice Date]<[Date change in front of customer] and [Is Sales Account]='Yes',[Sales Qty]))
/
52
))
/
(
Sum(if([Sales Invoice Date]>Date(AddMonths([Date change in front of customer],-12)) and [Sales Invoice Date]<[Date change in front of customer] and [Is Sales Account]='Yes',[Sales Qty]))
/
52
)

2 Replies
Specialist

In what way does it break? Does it give an error, does it do nothing,... Tell us a bit more on what exactly happens.

Partner

Hi

Break down your expression, put individuals part into variables.

then check variable values.

After that you can make your expressions in terms of variables.

Using this approach, It will be easy to find the place where it is failing.

Hope this will solve your problem.

Tags
Community Browser