Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Qlik® Product Spotlight: Discover what’s possible. Get more from our products.
See for yourself. Register today.
krishna4bo
Not applicable

Conditional selection

Hi All,

I created donut chart using below expressions.


Dimension: Status =Availability , Unavailability

Measure: if(Status ='Availability',Only({<Affected_Date={'$(=Max(Affected_Date))'}>}[Overall Availability%]),

if(Status='Unavailability',Only({<Affected_Date={'$(=Max(Affected_Date))'}>}[Unavailability%])))


My requirement:

Without any selection display only Todays data

If select Month display that month data.

If select Year display that Year data.


I created below code for text box

Ex: =if(GetSelectedCount(Affected_Month)>0,Round(Sum([Overall Availability%])/Count([Overall Availability%]))&''& '%',

Only({<Affected_Date={'$(=Max(Affected_Date))'}>}[Overall Availability%])&''& '%')


How to create same code for donut chart.

Thanks,

Krishna

Tags (1)
1 Reply
OmarBenSalem
Not applicable

Re: Conditional selection

maybe sthing like;

=if(GetSelectedCount(Affected_Month)=0 and GestSelectedCount(Year)=0,


if(Status ='Availability',Only({<Affected_Date={'$(=Today())'}>}[Overall Availability%]),

if(Status='Unavailability',Only({<Affected_Date={'$(=today())'}>}[Unavailability%])))

,

if(Status ='Availability',Only([Overall Availability%]),

if(Status='Unavailability',Only([Unavailability%])))


)


I mean, if u select a month or a year , u want to show the measure for the selected frame; thus no need to force sthing within the set expression; Qlik will automatically bring the measure for the selected time frame