Announcements
cancel
Showing results for
Did you mean:
Not applicable

## Get the Max per Row and its Date

Hello,

I have the following table:

 ID XK XTD YK YTD ZK ZTD 100 0,12 18/09/2013 17:28 0,25 10/09/2013 13:25 0,08 28/09/2013 22:10 100 0,23 18/10/2013 17:35 1,38 27/10/2013 7:53 0,17 12/10/2013 1:38 100 0,22 19/11/2013 17:18 0,20 05/11/2013 7:39 0,10 17/11/2013 18:17

Where:

• ID: Identifier
• XD/YK/ZK: Power
• XTD/YTD/ZTD: Time (HH:MM) and Date (DD/MM/YYYY) for the related Power.

So XK is related to XTD, YK is related to YTD and ZK is related to ZTD.

What I need is to get the max value between XK, YK and ZK for each row and also return the date for the corresponding Power.

In this example I should get:

 ID MAX DATE 100 0,25 10/09/2013 13:25 100 1,38 27/10/2013 7:53 100 0,22 19/11/2013 17:18

Do you know how could I do this?

I'd prefer doing this in the script.

Thank you!

1 Solution

Accepted Solutions
MVP

Load RowNo() as NO, * Inline

[

ID, XK, XTD, YK, YTD, ZK, ZTD

100, 0.12, 18/09/2013 17:28, 0.25, 10/09/2013 13:25, 0.08, 28/09/2013 22:10

100, 0.23, 18/10/2013 17:35, 1.38, 27/10/2013 7:53, 0.17, 12/10/2013 1:38

100, 0.22, 19/11/2013 17:18, 0.20, 05/11/2013 7:39, 0.10, 17/11/2013 18:17

];

Create a Straight Table

Dimension

NO
ID

Expressions

1)

RangeMax(XK,YK,ZK)

2)

IF(RangeMax(XK,YK,ZK) = XK, XTD,

IF(RangeMax(XK,YK,ZK) = YK, YTD, ZTD))

Go to presentation tab and select NO and Hide this column

2 Replies
MVP

Load RowNo() as NO, * Inline

[

ID, XK, XTD, YK, YTD, ZK, ZTD

100, 0.12, 18/09/2013 17:28, 0.25, 10/09/2013 13:25, 0.08, 28/09/2013 22:10

100, 0.23, 18/10/2013 17:35, 1.38, 27/10/2013 7:53, 0.17, 12/10/2013 1:38

100, 0.22, 19/11/2013 17:18, 0.20, 05/11/2013 7:39, 0.10, 17/11/2013 18:17

];

Create a Straight Table

Dimension

NO
ID

Expressions

1)

RangeMax(XK,YK,ZK)

2)

IF(RangeMax(XK,YK,ZK) = XK, XTD,

IF(RangeMax(XK,YK,ZK) = YK, YTD, ZTD))

Go to presentation tab and select NO and Hide this column

Not applicable
Author

Great! Thank you very much!

Community Browser