Qlik Community

New to Qlik Sense

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

Announcements
Support Case Portal has moved to Qlik Community! Read the FAQs to start exploring Support resources.
cancel
Showing results for 
Search instead for 
Did you mean: 
Reaperjay
Contributor
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
timpoismans
Specialist
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.

nilaksh92
Partner
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.