Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
ali_hijazi
Partner - Master II
Partner - Master II

get the amount of the max line number

Hello

I got a table that contains the ItemID, TransactionNo., and the StockAmount

on a specific date I may have the following data

ItemID     TransactionNo     StockAmount

27          13397068          5820.72

27          13389275          5849.45

27          13377953          5839.65

now I want to display on a pivot table the ItemId the maximum transactionNo. along with the related stockAmount

I put as dimension the ItemID

now the expressions are Expression1 and Expression2

Expression1 = Max(TransactionNo) and I get 13397068

Expression2 = StockAmount but I get -

what shall I do

Please advise

I can walk on water when it freezes
1 Solution

Accepted Solutions
ali_hijazi
Partner - Master II
Partner - Master II
Author

Actually I found out that the function FirstSortedValue solves my problem

FirstSortedValue({<PerioDate={"<=$(=PerioDate)"}>} StockAmount,-TransactionID)

I can walk on water when it freezes

View solution in original post

16 Replies
its_anandrjs

Hi,

You want to display only Max transaction no Details please clear it.

Regards,

Anand

ali_hijazi
Partner - Master II
Partner - Master II
Author

I want to display the expressions 1 and 2

what is the thing that is not clear?

I can walk on water when it freezes
its_anandrjs

Hi,

Ok means

1. 13397068

2. 5820.72

Regards,

Anand

ali_hijazi
Partner - Master II
Partner - Master II
Author

exactly

I can walk on water when it freezes
Sokkorn
Master
Master

Hi Ali,

For the second expression use this : SUM({<[TransactionNo]={$(=Max([TransactionNo]))}>}[StockAmount])

Check more on attached file.

Regards,

Sokkorn

its_anandrjs

Hi,

See the attached i think you need to use some thing like this.

Regards,

Anand

ali_hijazi
Partner - Master II
Partner - Master II
Author

still getting -

I can walk on water when it freezes
Sokkorn
Master
Master

Hi Ali,

Did you check my attached file?

Regards,

Sokkorn

ali_hijazi
Partner - Master II
Partner - Master II
Author

when I use sum({<TransactionNo={$(=max(TransactionNo))}>}StockAmount) I'm getting the maximum amount without taking into consideration the dimension!!!

I can walk on water when it freezes