Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I'm trying to rank certain values if greater than 1 will equal 40, but then also rank whatever is less than 1 to start with 30 and go in descending order as the percentage value decreases (30..29..28..etc). The result I get now is the least percentage value (67.82%) is receiving the 30 and the most (99.13%) is receiving the least. I just want it flipped if possible. See example of code below and results. Thank you to everyone who tries to help with this!
If(
(Sum({<%Date={"$(vMTD)"}>}Amt)
/
Count({<%Date={"$(vMTD)"},[PayType.PayType]={'C'},[RO_Detail.hasLabor]={1}>}distinct [%RO]))
/
Only({<%Date={"$(vMTD)"},[PayType.PayType]={'C'}>}BM_GrossRO)
<1.1
and
(Sum({<%Date={"$(vMTD)"}>}Amt)
/
Count({<%Date={"$(vMTD)"},[PayType.PayType]={'C'},[RO_Detail.hasLabor]={1}>}distinct [%RO]))
/
Only({<%Date={"$(vMTD)"},[PayType.PayType]={'C'}>}BM_GrossRO)
>=1,40,
if(
((Sum({<%Date={"$(vMTD)"}>}Amt)
/
Count({<%Date={"$(vMTD)"},[PayType.PayType]={'C'},[RO_Detail.hasLabor]={1}>}distinct [%RO]))
/
Only({<%Date={"$(vMTD)"},[PayType.PayType]={'C'}>}BM_GrossRO))
<1,
31-
Rank(-
((Sum({<%Date={"$(vMTD)"}>}Amt)
/
Count({<%Date={"$(vMTD)"},[PayType.PayType]={'C'},[RO_Detail.hasLabor]={1}>}distinct [%RO]))
/
Only({<%Date={"$(vMTD)"},[PayType.PayType]={'C'}>}BM_GrossRO))
))
Hi, at the end you have:
31-
Rank(-
((Sum({<%Date={"$
If you remove the minus in red (at the start of the Rank expression) you'll get the rank flipped.
Thank you for the reply but unfortunately it starts it at -1. I have a screenshot below with the result of removing that '-', the red shows what I'm trying to make it look like, if that helps.
Can you try to set the rank in a different expression to see the value it returns for each of those rows? to confirm that it really returns 32, 33, 34...
In that case you can use a count of the values above 100% to add it to the rank operation like:
31-
Rank(.... )
+ [NumOfValuesAbove100%]