Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
QLIKWORLD LIVE! MAY 16 - 19TH, EARLY BIRD DISCOUNTS! REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
paullawrence190
Contributor
Contributor

Back ground colours

Hi

I am using an if statement to set colours on a pie chart.  Which all works fine until i make a selection.  The pie still works as it uses set analysis but colours go when a date selected.

Pie Chart Expression:

=Count({<Pre={'Full Duties'},ReferFRP={'0'},Month=,SelectYear=,Completedcase={'-1'},Dischargedflag={'1'}>}[Main Cat])+ Count({<Pre={'Restricted Duties'},Dischargedflag={'1'},ReferFRP={'0'},Month=,SelectYear=,Completedcase={'-1'}>}[Main Cat])+Count({<Pre={'Off Work'},Dischargedflag={'1'} ,ReferFRP={'0'},Month=,SelectYear=,Completedcase={'-1'}>}[Main Cat])

Background colour:  If(Pre='Full Duties',RGB(0,255,0),If(Pre='Restricted Duties',RGB(255,191,0),If(Pre='Off Work',RGB(255,0,0))))

Can anyone offer any suggestions?

Many thanks

Paul

6 Replies
vijetas42
Specialist
Specialist

Please check persistent colors option from color tab of your chart

paullawrence190
Contributor
Contributor
Author

Makes no difference unfortunately.

jonathandienst
Partner
Partner

Try putting =PRE in a textbox and see what happens when you make a selection. Is PRE a field or a variable? If a field, how it associated with dates? If a variable, how is it defined?

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
vijetas42
Specialist
Specialist

What dimension you have used in pie chart and have you created month and selectyear from date that you are selecting?

paullawrence190
Contributor
Contributor
Author

Pre is a dimension.  Yes created a master calendar that this ignores in the expression.  when date is selected though it is removing colours as that field now not available.  thx

paullawrence190
Contributor
Contributor
Author

Yes thats how i found the issue.  Pre is associated with dates so that why i exclude from expression but cant exclude from colours.  thx  Paul