# Qlik Sense App Development

Contributor II

## colour by expression with date match qlik sense

Hi

I am using qlik sense

I have a table that has

ID, Date, DepartmentCode, Status

Note: Date is max(Date)

I wish to colour by expression the date column if anyone in the last 3 months places an order for an inactive department.

I have tried this

if (Max(Date) = AddMonths(Max(Date), -0) and Status = 'Inactive', Red(),

if (Max(Date) = AddMonths(Max(Date), -1) and Status = 'Inactive', Yellow(),

if (Max(Date) = AddMonths(Max(Date), -2) and Status = 'Inactive', Green(), white())))

with no joy

1 Solution

Accepted Solutions
MVP

## Re: colour by expression with date match qlik sense

May be this

if (Max(Date) = AddMonths(Max(TOTAL Date), -0) and Status = 'Inactive', Red(),

if (Max(Date) = AddMonths(Max(TOTAL Date), -1) and Status = 'Inactive', Yellow(),

if (Max(Date) = AddMonths(Max(TOTAL Date), -2) and Status = 'Inactive', Green(), white())))

2 Replies
MVP

## Re: colour by expression with date match qlik sense

May be this

if (Max(Date) = AddMonths(Max(TOTAL Date), -0) and Status = 'Inactive', Red(),

if (Max(Date) = AddMonths(Max(TOTAL Date), -1) and Status = 'Inactive', Yellow(),

if (Max(Date) = AddMonths(Max(TOTAL Date), -2) and Status = 'Inactive', Green(), white())))

Contributor II

## Re: colour by expression with date match qlik sense

Hi

brill thank you again

got close but not 'totally' close enough lol

Kind Regards