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

Help with expression for 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?

47 Replies
SunilChauhan
Champion
Champion

at what basis  u want to see this field Please make a clear requirement.

Thanks

Sunil

Sunil Chauhan
hopkinsc
Partner - Specialist III
Partner - Specialist III
Author

The ACCURATE stock level would be the one with the latest StoreDate and latest LastSoldDate.

Sample.JPG

In the above example, the correct line is the 2nd one down. This is the only line that i want it to display...

(It has the latest StoreDate with the Latest LastSoldDate)

SunilChauhan
Champion
Champion

TAKE MAX OF BOTH DATE IN SCRIPT GROUP BY AND RELOAD

I THINK WILL GIVE RESULT

Sunil Chauhan
hopkinsc
Partner - Specialist III
Partner - Specialist III
Author

Sorry Sunil, can you give me an example as i don't know what you mean.

Thanks

hopkinsc
Partner - Specialist III
Partner - Specialist III
Author

does anyone have any more suggestions please?

SunilChauhan
Champion
Champion

will u share data  for reload?

then only i will say u.

Sunil Chauhan
hopkinsc
Partner - Specialist III
Partner - Specialist III
Author

Hi, my QVD's are too big to attach for reload

swuehl
MVP
MVP

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!

hopkinsc
Partner - Specialist III
Partner - Specialist III
Author

Hi Stefan, That expression worked great, thanks very much.

I was wondering if you could break down the expression and explain what each part does so i can try and understand it ?

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

Thanks