Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to find max value?

Hi Folks,

How to find the max value based on receipt date...

I want to show only max receiptdate of max unit price

aaa.JPG

Regards,

Sub2u444

30 Replies
Kushal_Chawda

In front end You can do this by expression

=FirstSortedValue(distinct ReceiptDate, - aggr(max(UnitPrice),PartNo))

In script,

Data:

Load  PartNo,

         ReceiptDate,

          UnitPrice

From Table;


left join

load max(UnitPrice) as MaxUnitPrice,

       PartNo,

       1 as MaxUnitPriceFlag

Resident Data

group by PartNo;


left join

load PartNo,

       max(ReceiptDate) as MaxReceiptDate

resident Date

where MaxUnitPriceFlag=1

group by PartNo;

Not applicable
Author

Hi,

I got like this..

aaaaa.JPG

    I want the output like this..

PartNoReceiptDateUnit Price
115/03/201640
215/05/201680
1001/08/201590

Sub2u444

avinashelite

Thanks a lot its.anandrjs‌ its was a typo error from me

Anonymous
Not applicable
Author

Hi Subbu,

Try to use the Aggr function and giving a sample Expression as Follows....

Aggr(if(Rank(Sum([Unit Price])<=1,ReceiptDate),ReceiptDate)

Not applicable
Author

Hi,

Sorry, not getting the expected output..

getting like this..

abc.JPG

Sub2u444

Kushal_Chawda

try below expression

=FirstSortedValue(distinct UnitPrice, - aggr(max(ReceiptDate),PartNo))


or


FirstSortedValue(distinct UnitPrice, - ReceiptDate)

avinashelite

Try like this :

Max({<ReceiptDate={"=aggr(max(ReceiptDate),PartNo) ">}UnitPrice)

Not applicable
Author

Hi,

not getting any data..

Sub2u444.

its_anandrjs
Champion III
Champion III

Better if you create the Flag into load script.

Regards

Anand

avinashelite

Try this

=aggr(max(UnitPrice),PartNo)