Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Modernize Your QlikView Deployment webinar, Nov. 3rd. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
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
Highlighted
MVP & Luminary
MVP & Luminary

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

View solution in original post

18 Replies
Highlighted

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)
Highlighted
Not applicable

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

Highlighted
MVP & Luminary
MVP & Luminary

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

View solution in original post

Highlighted
Not applicable

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

Highlighted
Master
Master

As Rob Mentioned,

use the expression -> Back Ground Expression ->

Color Match for same ID-237764.PNG

-Hirish

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

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

Highlighted
Not applicable

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

Highlighted
Master
Master

Hi,

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

Check this,

PFA

Hirish

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

yes