Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Set Analysis solution

Hi Guys,

I need a syntax for the following problem


I have a table with dimensions; Vendor,Item,Time (po date) and the expression is unit price. What I need is the lastest Po date of that item with the corresponding unit price. With that price I will calculate with other fields. So when I troggle on Vendor or Item and time, I always need the latest PO with unit price from the database.


VENDOR NAMEITEMPO LINE CREATION DATEUNIT PRICE
AxFloX00587014-1-201437,62
AxFloX00587017-6-201440,68

I think this can be achieved with the correct set analysis in the presentation layer but perhaps a solution in the script is also no problem...

Thanks in advance

Best regards

Robert

2 Replies
ashfaq_haseeb
Champion III
Champion III

Try first sorted value

Like below

FirstSortedValue(UNIT PRICE, -PO LINE CREATION DATE)

Regards

ASHFAQ

alexandros17
Partner - Champion III
Partner - Champion III

I should solve on script side, simply doing this:

If your table name is myTable then

Load * resident myTable;

left join

Load max([creation date]) as [creation date], '1' as flag resident myTable group by [Vendor Name], Item;

Now you have a flag field showing max (per Vendor and Item), use this field in your expression with set analysis and it will work

Let me Know