# New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Not applicable

## Sense: Conditional colors with expression

Hi,

I have 2 Set analysis expression.

One for this year = Sum({\$<CalendarYear={\$(=Max(CalendarYear))},EnglishProductCategoryName={"Bikes"}>}SalesAmount)

One for preavious Year= Sum({\$<CalendarYear={\$(=Max(CalendarYear)-1)},EnglishProductCategoryName={"Bikes"}>}SalesAmount)

I have made an KPI chart - Now i want to use conditional color.

But have do i make it based on an expression saying if my number for this year is lower than last year, then red else if it is bigger then green.

i tried like this:

if(Sum({\$<CalendarYear={\$(=Max(CalendarYear))},EnglishProductCategoryName={"Bikes"}>}SalesAmount) > Sum({\$<CalendarYear={\$(=Max(CalendarYear)-1)},EnglishProductCategoryName={"Bikes"}>}SalesAmount), Green(),Red())

But i dont know where to type it, or to make it work.

Tags (3)
1 Solution

Accepted Solutions

## Re: Sense: Conditional colors with expression

In the KPI chart in Qlik Sense you cannot use color expressions like in QlikView. You're limited to the colors and glyphs that are available through the chart designer interface. You can use an expression to calculate the limit, but you might as well set it to zero and use as measure

Sum({\$<CalendarYear={\$(=Max(CalendarYear))},EnglishProductCategoryName={"Bikes"}>}SalesAmount) - Sum({\$<CalendarYear={\$(=Max(CalendarYear)-1)},EnglishProductCategoryName={"Bikes"}>}SalesAmount)

talk is cheap, supply exceeds demand
2 Replies

## Re: Sense: Conditional colors with expression

In the KPI chart in Qlik Sense you cannot use color expressions like in QlikView. You're limited to the colors and glyphs that are available through the chart designer interface. You can use an expression to calculate the limit, but you might as well set it to zero and use as measure

Sum({\$<CalendarYear={\$(=Max(CalendarYear))},EnglishProductCategoryName={"Bikes"}>}SalesAmount) - Sum({\$<CalendarYear={\$(=Max(CalendarYear)-1)},EnglishProductCategoryName={"Bikes"}>}SalesAmount)

talk is cheap, supply exceeds demand
New Contributor II