# New to QlikView

Discussion board where members can get started with QlikView.

Highlighted
Not applicable

## field max in the table

hello,
I have a table of QlikView this:

I need to turn this table by display only the row with the maximum value of the field cost with the aggregation on the field A.

in this way:

 A B data max costo 00001 00030 12/12/2014 1,737 00002 00001 12/12/2014 1,735 00002 00024 12/12/2014 1,735 00019 00024 12/12/2014 1,735 00024 55357 12/12/2014 1,735 00027 51443 12/12/2014 1,615 00030 00024 12/12/2014 1,735 00033 00041 12/12/2014 1,745 00035 00036 12/12/2014 1,754 00036 00040 12/12/2014 1,754

What kind of transformations / expressions should I enter?

Thanks
Alex

Tags (3)
1 Solution

Accepted Solutions
MVP

## Re: field max in the table

Create a Straight Table

Use

Dimension

A

and below three different expressions

FOR B

=FirstSortedValue(Distinct B, -Aggr(SUM(costo),A,B))

FOR data

=FirstSortedValue(Distinct data, -Aggr(SUM(costo),A,B))

For SUM(costo)

=FirstSortedValue(Distinct Aggr(SUM(costo),A,B), -Aggr(SUM(costo),A,B))

6 Replies
Contributor III

## Re: field max in the table

Hi Alessandro,

switch it to straight table and create expression max(value).

M

Partner

## Re: field max in the table

Hello

You can try with firstsortedvalue function.

MVP

## Re: field max in the table

Create a table

Dimension

A

Expression

=FirstSortedValue(Distinct B, -Aggr(SUM(costo),A,B))

=FirstSortedValue(Distinct data, -Aggr(SUM(costo),A,B))

=FirstSortedValue(Distinct Aggr(SUM(costo),A,B), -Aggr(SUM(costo),A,B))

Not applicable

## Re: field max in the table

that way I lose the information of the field b.
Could you write me an example.
Thank you very much
Alex​

Not applicable

## Re: field max in the table

I did not understand where I should insert the given expression.
you give me an example explicit about it?
thanks
Alex

MVP

## Re: field max in the table

Create a Straight Table

Use

Dimension

A

and below three different expressions

FOR B

=FirstSortedValue(Distinct B, -Aggr(SUM(costo),A,B))

FOR data

=FirstSortedValue(Distinct data, -Aggr(SUM(costo),A,B))

For SUM(costo)

=FirstSortedValue(Distinct Aggr(SUM(costo),A,B), -Aggr(SUM(costo),A,B))