Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Highlighted
Not applicable

Colours in legend for the same dimension values

Hi All

I have a bar chart in which i'm comparing the current month data, to the previous month data using two expressions

and two dimensions

I have Legend as follows what i want

all the countries should have same colours in comparision with previous month

if one country is green in colour in current month it should be the same colour in previous month

1 Solution

Accepted Solutions
MVP & Luminary
MVP & Luminary

Re: Colours in legend for the same dimension values

If you have 18 or fewer countries you can add this background color expression to each expression:

=color(FieldIndex('Country', Country))

If you have more than 18 Country values you have to tweak the expression a bit like this:

=color(

  RangeMax(

  Mod(FieldIndex('Country', Country),18)

  ,1)

)

-Rob

http://masterssummit.com

http://qlikviewcookbook.com

18 Replies

Re: Colours in legend for the same dimension values

Would you share the application or expressions

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
Not applicable

Re: Colours in legend for the same dimension values

for current month   sum({$<MonthYear={"=$(=max(MonthYear))"}>}Value )

for previous month  sum({$<MonthYear={"$(=date(AddMonths(max(MonthYear),-1),'YYYYMM'))"}>}Value )

for pre previous month  sum({$<MonthYear={"$(=date(AddMonths(max(MonthYear),-2),'YYYYMM'))"}>}Value )

Top two values in current month comparing the same values with previous month

that is the thread where my application is and its name is 67.qvw

below iss the chart i japan is blue in colour in 2016 06 then it should be blue in colour in the previous month as well

MVP & Luminary
MVP & Luminary

Re: Colours in legend for the same dimension values

If you have 18 or fewer countries you can add this background color expression to each expression:

=color(FieldIndex('Country', Country))

If you have more than 18 Country values you have to tweak the expression a bit like this:

=color(

  RangeMax(

  Mod(FieldIndex('Country', Country),18)

  ,1)

)

-Rob

http://masterssummit.com

http://qlikviewcookbook.com

Not applicable

Re: Colours in legend for the same dimension values

Hi Rob

Thank god, i'm a very excited that you replied to me, i regularly follow your posts,

I have been struck in a an issue since the last 1 month

But the expression you provided is not working for me

i'm looking for something like this

fro three different countries three colours and and the same country in the previous month have the same colour as the current month

HirisH_V7
Honored Contributor

Re: Colours in legend for the same dimension values

As Rob Mentioned,

use the expression -> Back Ground Expression ->

Color Match for same ID-237764.PNG

-Hirish

HirisH
“Aspire to Inspire before we Expire!”
Not applicable

Re: Colours in legend for the same dimension values

hi can u please atatch the sample qvw i tried it but not working

Not applicable

Re: Colours in legend for the same dimension values

i'm getiing a unique colour i want a different colour for differt values

HirisH_V7
Honored Contributor

Re: Colours in legend for the same dimension values

Hi,

do u need same color for every country,For every month right!!!

Check this,

PFA

Hirish

HirisH
“Aspire to Inspire before we Expire!”
Not applicable

Re: Colours in legend for the same dimension values

yes