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

Set Analysis

Hi,

I have one inline table:

**********************************************************

Data:

Load *

Inline

[

Server, Usage

A,10

B,25

A,15

B,12

A,40

C,25

C,30

];

**********************************************************

Now, I want to see which server has the max usage. I want to do that in expression.

using max(aggr(sum(Usage),Server)), I can figure out the max usage of the server but how I can get the name of server.

Thanks,

Kamal

1 Solution

Accepted Solutions
Kushal_Chawda

try this

= max({<Server ={"=sum(Usage)>0"}>}Usage)

=FirstSortedValue(DISTINCT Server, -aggr(sum(Usage),Server))

View solution in original post

21 Replies
Kushal_Chawda

try this

= max({<Server ={"=sum(Usage)>0"}>}Usage)

=FirstSortedValue(DISTINCT Server, -aggr(sum(Usage),Server))

trdandamudi
Master II
Master II

May be as below:

firstsortedvalue ( Server, -Usage )

kamal_sanguri
Specialist
Specialist
Author

and i dont want to use variables to calculate the usage of individual servers.. .

kamal_sanguri
Specialist
Specialist
Author

It didn't work..sorry

Kushal_Chawda

what is the output you need for below data

Data:

Load *

Inline

[

Server, Usage

A,10

B,25

A,15

B,12

A,40

C,25

C,30

C,15

];

Kushal_Chawda

This will not work .. as it will not aggregate the data for server and will give you wrong result

kamal_sanguri
Specialist
Specialist
Author

the server which has the most usage. so technically after group by the server with max usage.

Capture.PNG

trdandamudi
Master II
Master II

How about the below:

=firstsortedvalue (Server, -Aggr(Sum(Usage),Server ))

kamal_sanguri
Specialist
Specialist
Author

Correct this time..