Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Calculation independent from selections

I have a dashboard with performance % for day selected but also want to include performance % for the whole week up to date selected.

Many thanks

Jess

12 Replies
stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

I would solve that in the load script by doing this:

[Arrival Date],

Dual(WeekYear([Arrival Date]) & '-' & Week([Arrival Date]), WeekStart([Arrival Date])) as [Arrival Week],

Note that you will need the square brackets and space in the Set Analysis if you go with this.  Or you could just drop the space.

Steve

Anonymous
Not applicable
Author

Still showing nothing.

This is my preceding load script (selection is based on departuredate field):

LOAD

*,

ArrDateTime as ArrivalTime2,

InitCompl as InitCompl2,

Date(Floor(DepartureDate)) as [DepDate],

  Year(DepartureDate) as Year,

  Month(DepartureDate) as Month,

  Week(DepartureDate) as Week,

  Day(DepartureDate) as Day,

  Date(MonthStart(DepartureDate), 'MM-YYYY') as MonthYear,

  Dual(WeekYear(DepartureDate)&'-'&Week(DepartureDate),WeekEnd(DepartureDate)) as [Arrival Week];

Expression:

Count({$<[ArrivalDate], [Arrival Week] = p([Arrival Week]), AEMinsInDept {'<=240'}>} INPATIENT_DATA_ID)/Count({$<[ArrivalDate], [Arrival Week] = p([Arrival Week])>} INPATIENT_DATA_ID)

stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

As you are selecting DepDate, you will need to exclude that selection in the set analysis:

Count({$<[ArrivalDate]=, [Arrival Week] = p([Arrival Week]),DepDate=, AEMinsInDept={"<=240"}>} INPATIENT_DATA_ID)/Count({$<[ArrivalDate]=, [Arrival Week] = p([Arrival Week]),DepDate=>} INPATIENT_DATA_ID)


Also, the expression was missing an equals sign after AEMinsInDept and was using the wrong quotes around the 240 minutes (though that that shouldn't have broken it).


Does your Arrival Date field have a space in it, by the way?


The best way to test Set Analysis functions is to add a bit in at a time and see what you get.


Try just this first:


Count({$<AEMinsInDept {"<=240"}>} INPATIENT_DATA_ID)/Count({$} INPATIENT_DATA_ID)


See if that works.  Then add some more:


Count({$<[ArrivalDate]=,AEMinsInDept={"<=240"}>} INPATIENT_DATA_ID)/Count({$<[ArrivalDate]=>} INPATIENT_DATA_ID)


Steve