Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
NickHoff
Specialist
Specialist

Rank in set analysis with rank calculation option

I created an inline table to give me an option which calculation i'd like to sort my rank by:

LOAD * INLINE [

Metric, Expression

Volume, COUNT(DISTINCT SurgicalCaseSk)

Meditech Cost, (SUM(ItemCostAmt)/COUNT(DISTINCT SurgicalCaseSk))*SUM(SurgicalUsedQty)

Meditech Cost Per Case,SUM(ItemCostAmt)/COUNT(DISTINCT SurgicalCaseSk)

Supply Chain Cost Per Case,(SUM(ContractLIUOMPriceAmt)/COUNT(DISTINCT SurgicalCaseSk))

Supply Chain Cost,(SUM(ContractLIUOMPriceAmt)/COUNT(DISTINCT SurgicalCaseSk))*SUM(SurgicalUsedQty)

];

I have the following set which is not working as intended:

=COUNT({<ProcedureSurgeonName = {"=RANK(Expression),4)<=$(vTopPhysicians)"}>}DISTINCT SurgicalCaseSk)

The set will work if I use an individual calculation and a nested if statement instead of Expression.  However, I am told I can include the field name for the parameter with the expression.  I've tried wrapping the expression in the inline table " ", but that didn't work either

1 Solution

Accepted Solutions
Kushal_Chawda

Hi,

Use the below expression

=COUNT({<ProcedureSurgeonName = {"=rank($(=Expression),4)<=$(vTopPhysicians)"}>}DISTINCT SurgicalCaseSk)

You need to use $ to evaluate the calculation of expression

Please see the attached app I tested.

View solution in original post

14 Replies
sunny_talwar

Seems like you have a extra parenthesis after the word Expression. Try this:

=Count({<ProcedureSurgeonName = {"=RANK(Expression,4)<=$(vTopPhysicians)"}>}DISTINCT SurgicalCaseSk)

NickHoff
Specialist
Specialist
Author

It seemed like the syntax was correct, but my rank is not working as expected.  When putting the rank formula in a text box it gives the result of -1

sunny_talwar

The one you had initially was correct??? I am not sure because I have no way to test this without sample data. That was my guess.

NickHoff
Specialist
Specialist
Author

Will it work by pulling in the expression from the inline table to the rank parameter or do i need something else?

sunny_talwar

That's what I am trying to tell you that I won't know until I have something to test it with. You have the data, why don't you test it to see if it works or not if you put the expression directly in there

NickHoff
Specialist
Specialist
Author

It should work with any set of data.  I'm just trying to do the following, the vTopPhysicians is a slider variable: 

=RANK(Expression,4)<=$(vTopPhysicians)

Expression 4 is from an inline table, which has different calculations on how to rank.

NickHoff
Specialist
Specialist
Author

The result of =RANK(Expression,4)<=$(vTopPhysicians) is -1

Kushal_Chawda

Instead of Expression field ,have you tried putting actual expression?

NickHoff
Specialist
Specialist
Author

Yes Kush, and the results display correctly, but without using a nested if statement that will slow down the application I can't have multiple conditions.  I was told it's possible to use the expression from an INLINE instead of using the nested if, but i can't seem to get it right.