Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Set analysis using if statement

Hi..

I need to calculate service availability by using outage mins and total mins.

Fields are as below -

Total mins - MINS_IN_MON

Outage mins - CUSTOMER_IMPACT_MINS

Outage month - PERIOD NAME

I need to display YTD values only if Outage mins are greater than zero, and the formula needs to be independent of the filter Outage month i.e. PERIOD NAME

Formula for service availability is 1 - (CUSTOMER_IMPACT_MINS/MINS_IN_MON ).

Can somebody please help to write the expression?

1 Solution

Accepted Solutions
jonathandienst
Partner - Champion III
Partner - Champion III

Then it would look something like:

1 - Sum(CUSTOMER_IMPACT_MINS)/Sum(MINS_IN_MON)

or

1 - Sum({<[PERIOD NAME]>} CUSTOMER_IMPACT_MINS)/Sum({<[PERIOD NAME]>} MINS_IN_MON)

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

View solution in original post

7 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

How would you like to aggregate the service availability over multiple months? I assume an average. Something like:


=Avg(Aggr(1 - (CUSTOMER_IMPACT_MINS/MINS_IN_MON), [PERIOD NAME]))

or

=Avg(Aggr(If(CUSTOMER_IMPACT_MINS > 0, 1 - (CUSTOMER_IMPACT_MINS/MINS_IN_MON)), [PERIOD NAME]))

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

Can you try with any expression, if yes please post that

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
jonathandienst
Partner - Champion III
Partner - Champion III

To ignore the PERIOD NAME selection:

=Avg({<[PERIOD NAME]>} Aggr(1 - (CUSTOMER_IMPACT_MINS/MINS_IN_MON), [PERIOD NAME]))

or

=Avg({<[PERIOD NAME]>} Aggr(If(CUSTOMER_IMPACT_MINS > 0, 1 - (CUSTOMER_IMPACT_MINS/MINS_IN_MON)), [PERIOD NAME]))

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Anonymous
Not applicable
Author

Its not an average. Its merely sum of all the outage mins divided by the sum of total minutes

jonathandienst
Partner - Champion III
Partner - Champion III

Then it would look something like:

1 - Sum(CUSTOMER_IMPACT_MINS)/Sum(MINS_IN_MON)

or

1 - Sum({<[PERIOD NAME]>} CUSTOMER_IMPACT_MINS)/Sum({<[PERIOD NAME]>} MINS_IN_MON)

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Anonymous
Not applicable
Author

the values get populated correctly but they change once I select the month filter. I need these to be independent of the filter

Anonymous
Not applicable
Author

I made a few minor changes and this is how it worked

if(sum({<PERIOD_NAME=,}CUSTOMER_IMPACT_MINS)>0,1- (sum({<PERIOD_NAME=>}CUSTOMER_IMPACT_MINS)/sum({<PERIOD_NAME= >}MINS_IN_MON)))