Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Highlighted
rakischotoe
New Contributor

Deduplicate and highest value in chart

Hi,

I have the following problem:

I have a table with "Poliy_nr", "Loss_nr" and "Amount":

The table is as following:

Policy_nr         Loss_nr          Amount

50899              1                        1.000           

50899              2                        1.000 

50899              3                        1.000 

12987              1                        2.000

12987              2                        2.000

81790              1                        3.000

81790              2                        3.000

81790              3                        3.000

81790              4                        3.000

81790              5                        3.000

13343              1                        4.000

13343              2                        4.000

I just want the highest "Loss_nr" in eacht "Policy_nr".

The result must show the following:

Policy_nr         Loss_nr          Amount

50899              3                        1.000 

12987              2                        2.000

81790              5                        3.000

13343              2                        4.000

Hopefully somebody can help me how I can achieve this.

I am struggling this problem for days without any success.

1 Solution

Accepted Solutions
Digvijay_Singh
Honored Contributor III

Re: Deduplicate and highest value in chart

Gud, If you feel so please mark maxgro‌ 'response' as right answer to close the thread.

9 Replies
lironbaram
Honored Contributor II

Re: Deduplicate and highest value in chart

hi

for loss_nr you can use a simple max

for the amount you can use firstsortedvalue(Amount,-Loss_nr)

MVP
MVP

Re: Deduplicate and highest value in chart

firstsortedvalue(Loss_nr,-Loss_nr)

firstsortedvalue(Amount,-Loss_nr)

1.png

rakischotoe
New Contributor

Re: Deduplicate and highest value in chart

It might be a stupid question, but I am new to Qlikview. Could you please explain how I can use the "max" en if I have to do that in the script of priorities of the chart and on which tab.

rakischotoe
New Contributor

Re: Deduplicate and highest value in chart

I tried but without any success. Is it possible to send me an example in a qvw?

Digvijay_Singh
Honored Contributor III

Re: Deduplicate and highest value in chart

Like this!

MVP
MVP

Re: Deduplicate and highest value in chart

It's a straight table chart with 1 dimension and the 2 expressions I posted,

you can find the chart in Digvijay Singh attachment (175884.qvw)

rakischotoe
New Contributor

Re: Deduplicate and highest value in chart

Thanks a lot! It works.

rakischotoe
New Contributor

Re: Deduplicate and highest value in chart

Thanks Massimo Grossi and Digvijay Singh, you both really helped me.

I am very happy to have the solution finely!

Digvijay_Singh
Honored Contributor III

Re: Deduplicate and highest value in chart

Gud, If you feel so please mark maxgro‌ 'response' as right answer to close the thread.