Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

oracleman
New Contributor

Having a problem with pie charts, can someone help please

Very new to QlikSense btw

Here's my data


Actvity_id, Status

1,S

2,S

3,S


where status s=success, f=fail, r=running


I want to display a donut pie where for each activity (only 3 on a any day), there is a specific colour for each status

s=green

f=red

r=orange


So we should get a ring of green if all activities are successfully completed. or one third of the donut will look red if theres been a failure.

Can someone help please?

Imran

3 Replies
Ivan_Bozov
Valued Contributor

Re: Having a problem with pie charts, can someone help please

Hi! Use color by expression:


If(Status='S', Green(), If(Status='F', Red(), If(Status='R', RGB(255,165,0))))

omarbensalem
Esteemed Contributor

Re: Having a problem with pie charts, can someone help please

What I would suggest is :

Create a MASTER DIMENSION: ValueList('sucess','fail','running')

Create a MASTER MEASURE:

if(ValueList('sucess','fail','running')='sucess', count({<Status={'S'}>}Activity_id),

if(ValueList('sucess','fail','running')='fail', count({<Status={'F'}>}Activity_id),

if(ValueList('sucess','fail','running')='running', count({<Status={'R'}>}Activity_id) )))

Now, create a pie chart,

as dimension, use your master dimension

as measure , use your master measure

then color by EXPRESSION:

if(ValueList('sucess','fail','running')='sucess', green(),

if(ValueList('sucess','fail','running')='fail', red(),

if(ValueList('sucess','fail','running')='running', '#f8981d' )))

result:

Capture.PNG

oracleman
New Contributor

Re: Having a problem with pie charts, can someone help please

Fantastic. Thanks to both of you.