Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
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.

1 Solution

Accepted Solutions
Gysbert_Wassenaar

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

View solution in original post

2 Replies
Gysbert_Wassenaar

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