Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
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

1 Reply
OmarBenSalem

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