Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

stabben23
Honored Contributor

Change Background color on Rank

Hi,

is it possible to change the background color that depends on the Rank Value.

In my example I have 9 account and I want to show them in separate textobject. The textbox included '1050' should in this case be green. Is it possible for the textobject to know about the dimension outside the object it self? The expression is sum({$<Account={'50'}>}Value)

//Staffan2013-12-20_0752.png

Tags (2)
1 Solution

Accepted Solutions
MVP
MVP

Re: Re: Re: Re: Change Background color on Rank

PFA

21 Replies
rohit214
Contributor III

Re: Change Background color on Rank


in text box>>properties >> colur>>caculate>> make expression

if(Account='50',Red())

thanks

rohit

stabben23
Honored Contributor

Re: Change Background color on Rank

Hi Rohit,

It has to be dynamic, tomorrow account 40 is highest.

//Staffan

MVP
MVP

Re: Re: Change Background color on Rank

Is it that, you want to max value dynamically. PFA

Expression, something like (in text box):

=FirstSortedValue(Aggr(Sum(Amt),Months), -Aggr(Sum(Amt), Months))

stabben23
Honored Contributor

Re: Change Background color on Rank

if(Rank(aggr(sum(Value),Account))=1,lightGreen(),lightred()) is my calculated backgroundcolor that dont works right now.

stabben23
Honored Contributor

Re: Change Background color on Rank

Hi tresesco,

Not exact, I will get green in all the boxes with this expression

if(FirstSortedValue(Aggr(Sum(Value),Account), -Aggr(Sum(Value), Account)),Green(),red())

That is because this is the highest value in "just this textbox" it has to compare "outside the box" with all other Account values. Because all Account will be shown in there own textobject, and the highest sum(Value) should be green.

//Staffan

MVP
MVP

Re: Re: Change Background color on Rank

Well, so your text boxes are specific to acounts.

Then try like:

If( Aggr(If(Account='50', Rank(Sum(Value))), Months) =1, lightgreen(), red())

If this doesn't work, please share your sample app.

stabben23
Honored Contributor

Re: Change Background color on Rank

Yes they are specific to Account, and I can not harcode 50 in my expression, because tomorrow it could be another Account with the highest Value. You can see on top in this discussion how it should be, this is just an example.

I havent "draw" all textboxes but have in mind that you have a Textobject for each Account. And the Account with the highest Value should be "Highligted" Green as you se in the table.

//staffan

rohit214
Contributor III

Re: Change Background color on Rank


Hi ,

PFa

Hope it helps.

Thanks

Rohit

MVP
MVP

Re: Re: Change Background color on Rank

Then how do you decide on number of text boxes? Is it something like: first text box for Rank 1, then second textbox for rank -2 ?
Please attach a sample app explaining the exact output.

Community Browser