Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a pivot table where a Claimant ID could have two different Policy_Name for the same period:
Claimant ID | Relationship | Policy_Name | Period | 2020-01 | 2020-02 | 2020-03 |
dc0d0aa5f56ad27 | Spouse | HSA Plan | - | $35,816.29 | $39,351.31 | |
dc0d0aa5f56ad27 | Spouse | PPO Plus Plan | $76,226.88 | $76,226.88 | $76,226.88 | |
840c248c19359b2 | Spouse | PPO Plan | $2,064.24 | $2,206.29 | $2,206.29 | |
840c248c19359b2 | Spouse | PPO Plus Plan | $62,536.81 | $102,302.02 | $103,459.70 |
My requirements are to sum payment amount by Claimant ID and to pick the policy name that had contributed the highest percentage to the total summed claims. The results should look like this:
Claimant ID | Relationship | Policy_Name | Period | 2020-01 | 2020-02 | 2020-03 |
dc0d0aa5f56ad27 | Spouse | PPO Plus Plan | $76,226.88 | $112,043.17 | $115,578.19 | |
840c248c19359b2 | Spouse | PPO Plus Plan | $64,601.05 | $104,508.31 | $105,665.99 |
Is this possible? My expression is already a set analysis:
Sum({<[WHLarge_Claims.Period]={$(=concat(DISTINCT chr(39) & [Large Claim Month Selector] & chr(39), ','))}>}[Payment_Amount])
May be use a calculated dimension for Policy_Name
Aggr(
FirstSortedValue(Policy_Name, -Aggr(Sum([Payment_Amount]), [Claimant ID])
, [Claimant ID])
Sunny,
Correct me if I'm wrong but doesn't FirstSortedValue grab the first value loaded into the table? My highest Payment_Amount will not always be the first row loaded.
It will pick the First Values based on sorting. In our case, we are telling to pick the first value where Policy_Name is sorted in descending order of Sum of Payment_Amount