In my dashboard i am calculating median value for No of days spent at hospital for patients as per the drugs,
So the metric which i am using is :
median(aggr([No of days],Patient,Drug))
But this is really killing the performance of my dashboard.
Does anyone has any other alternative for this median calculations without using AGGR functions.
If you have a table with Patient and Drug as dimensions, then the simple =Median([No of days]) will do what you require.
If you use a straight table, you can then decide how to handle the total (an expression total is probably wrong, or you can sum/average/... the rows, or have no total).
I am not even sure what you are trying to get and that is why I recommend showing an example out of QlikView to explain what is that you are looking to get.
Not sure if you don't have an inner aggregation in your real scenario, but this isn't even right... take a look at this
A is associated with two patients with two different NoOfDays.... and since the no of days don't match, the inner part of your expression is 0 for Drug A. Is this really what you want?
All i want is to calculate median value for No of days spent at hospital for patients as per the drugs.
But patients should be inner aggregation . Patient is not a dimension in straight table.