Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
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.
Regards
Khushboo
Do you have duplicate rows for No of days for a combination of Patient and Drug? This alone isn't working? Median(No of days])
No this alone wont work because we need median at patient level for each product.
Do you have a sample you can share?
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).
Hi Jonathan,
No we cant use patient as a dimension.
We have only Drug as a dimension.
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.
Hi Sunny,
PFA attached sample qvw for median .
Let me know if there is a way to avoid AGGR.
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.