Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
selvakumara
Creator
Creator

Color consistency b/w Bar chart vs Pie Chart

Hi ,

I have a requirement like below.

I want to show the same color for Pie chart as well as bar chart.

Dimension for  Bar chart --  I used 2 dimensions (Month Name (Jan-17).... Dec-17 ,Days)


Days Dimension -- I have used 

if([xyz] <=1, 'Below 1 day'

',if([xyz] <=3,  'Below 2-3 day'

',if([xyz] <=7,'Below 3-7 day'

',if([xyz] <=17,'Below  8-17 day'

',if([xyz] <=30, 'Below 18-30 day'

,above 30 days

)'))))



Measure - Used    Count([xyz])+ 0 * Count([xyz])



Same thing for pie chart also


I used color by expression in both charts

if([xyz] <=1, Yellow()

',if([xyz] <=3, blue()

',if([xyz] <=7, Green()

',if([xyz] <=17, brown()

',if([xyz] <=30, red()

,Red()

)'))))

But still it's not coming correctly. Kindly help me on this

Thanks in Advance

12 Replies
sunny_talwar
MVP
MVP

In essence, use the same set analysis that you use in your expression here

Only({<SetAnalysisFromYourExpression>}

if([xyz] <=1, Yellow()

',if([xyz] <=3, blue()

',if([xyz] <=7, Green()

',if([xyz] <=17, brown()

',if([xyz] <=30, red()

,Red()

)'))))

)

selvakumara
Creator
Creator
Author

Finally I got it.  Thanks Sunny

sunny_talwar
MVP
MVP

Super, please close the thread by marking correct and helpful responses.

Best,

Sunny