Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

hopkinsc
Valued Contributor II

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
MVP
MVP

Re: Help with expression showing latest details

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

2 Replies
MVP
MVP

Re: Help with expression showing latest details

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
Valued Contributor II

Re: Help with expression showing latest details

Hi, Stefan, Thanks that looks very promising!

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

Thanks!

Community Browser