Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
hopkinsc
Partner - Specialist III
Partner - Specialist III

Help with expression showing latest details

Hi, i am trying to display the current stock level for every product (for the selected department) for every store.

I have had some help with this before but still can't get it right.

My chart currently shows multiple lines for most of the products (this is because every store sends in a file every night detailing their stock details, so QLIKVIEW is showing me every occurence of the product). I only want to see the last file date that was processed (the field is StoreDate).

I want to see 1 line for each product showing the last file processed with the latest LastSoldDate but it has to display the accurate StockLevel for each product.

I have attached a sample.

Can anyone help please?

This has also been posted in New to Qlikview

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Hi,

not completely sure what your requirement (i.e. what the correct stock level) is, but I tried

=if(If(Max(Aggr(NODISTINCT Max(LastSoldDate),[Product Code], StoreNumber)) = LastSoldDate, LastSoldDate) = StoreDate, StockLevel)

as expression.

See also attached doc.

Regards,

Stefan

View solution in original post

2 Replies
swuehl
MVP
MVP

Hi,

not completely sure what your requirement (i.e. what the correct stock level) is, but I tried

=if(If(Max(Aggr(NODISTINCT Max(LastSoldDate),[Product Code], StoreNumber)) = LastSoldDate, LastSoldDate) = StoreDate, StockLevel)

as expression.

See also attached doc.

Regards,

Stefan

hopkinsc
Partner - Specialist III
Partner - Specialist III
Author

Hi, Stefan, Thanks that looks very promising!

I will put it onto the server and reload it and let you know

Thanks!