Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.

Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Announcements

Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution.
**READ ALL ABOUT IT!**

- Qlik Community
- :
- Forums
- :
- Analytics
- :
- App Development
- :
- Help With Colourmix1 Expression

Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Not applicable

2017-08-24
06:45 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Help With Colourmix1 Expression

Hello everyone,

I have a colourmix expression that looks like so:

Colormix1(sum($(vExpenditureAmount))-$(=min(aggr(sum($(vExpenditureAmount)), [Expense Category]))))/$(=(max(aggr(sum($(vExpenditureAmount)), [Expense Category]))-min(aggr(sum($(vExpenditureAmount)), [Expense Category])))),white(), $(vDenim))

The variable, vExpenditureAmount, looks like so:

sum([Session Transaction Fee]) +

sum([Merchandise Shipping Fee Charged]) +

sum([Institutional Transaction Fee]) +

sum([Institutional Transaction Fee]) +

sum([University Transaction Fee]) +

sum([Marketing Cost]) +

sum([Admin Expense]) +

sum([Operation Cost]) +

sum([Misc. Cost]) +

sum([IT Expenses Cost]) +

sum([IT Investment Total]) +

sum([Salary Total]) +

sum([CP Total])

When writing the colourmix1 expression I am given no error message and when I press apply, my piechart remains grey.

What is it that I am doing wrong?

Thank you in advance,

Alison

1,293 Views

5 Replies

Lesny_Eva

Partner - Contributor II

2017-08-24
06:57 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

I assume that the formula you use gives a "wrong" result. Colormix expects a value between 0 and 1.

Colormix1 (Value , ColorZero , ColorOne)

"Value" needs to be a real number between 0 and 1.

How does your vDenim look like? It could also be that that one is not correct and therefore Qlik doesn't know what colour to use.

1,137 Views

Not applicable

2017-08-24
11:30 AM

Author

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Hello Eva,

Thank you for your response.

Sorry, I am unsure of what you mean by my formula giving a 'wrong' result.

vDemin looks like this:

RGB(21, 96, 189)

I'm pretty sure there's no issue with that as I've used it in other visualisations without complaint.

1,137 Views

Lesny_Eva

Partner - Contributor II

2017-08-24
11:47 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

The calculation you are using:

*sum($(vExpenditureAmount))-$(=min(aggr(sum($(vExpenditureAmount)), [Expense Category]))))/$(=(max(aggr(sum($(vExpenditureAmount)), [Expense Category]))-min(aggr(sum($(vExpenditureAmount)), [Expense Category]))))*

needs to between 0 and 1. If it is 2 it cannot be coloured.

I made a dummy table:

I used this to colour the column

ColorMix1(if(wildmatch(City, 'Bern'),2, if(wildmatch(City, 'Berlin'),0,1)), blue(), red())

The number is calculated using the same formula.

If the city is Bern, assign it the value 2, if it's Berlin the value 0 and everything else gets the value 1

As you can see, it correctly colours "1" with red, and "0" with blue. The "2" is not coloured though, and I didn't get an error in my formula (as Qlik doesn't know it can contain numbers bigger than 1)

1,137 Views

Not applicable

2017-08-24
11:56 AM

Author

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Hello Eva,

I think I understand somewhat. But I am unsure how how best to amend my expression in light of your comment. Do you know how I could do it?

1,137 Views

Lesny_Eva

Partner - Contributor II

2017-08-24
12:02 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

First way is to check whether I am right - best way might be a table where you can check what value it gives you for your selected row dimension.

Your expression is really complicated, so I have no idea what it actually does.

But checking what kind of values you get might push you in the right direction on what you could change in the expression.

1,137 Views

Community Browser