Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
absekrafi
Creator III
Creator III

miximum date value where a field a table is not null

Hi Qlikview community,

I have a table containing stock values of materials.

I want to show the Max (date) where the QTE_STOCK_MP field is not null.

I tried the expression below but it didn't work.

Could you please help me out?

={1<PROD_MP={1},DATE_TRANS=Max(DATE_TRANS) where QTE_STOCK_MP <>0}

Thank you in advance

1 Solution

Accepted Solutions
MayilVahanan

Hi @absekrafi 
Try like below

Aggr(Max(if(not isnull(QTE_STOCK_MP ),DATE_TRANS)),Product) 
or

Max(Aggr(if(not isnull(QTE_STOCK_MP ),DATE_TRANS),Product,DATE_TRANS))

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.

View solution in original post

4 Replies
QFabian
Specialist III
Specialist III

Hi, i feel that something else is missing in your expression, but here you have an exmple :

Max(if(not isnull(QTE_STOCK_MP ),DATE_TRANS))

 

QFabian
absekrafi
Creator III
Creator III
Author

Hi QFabian,

With this expression I have the stock date of 1 product only. I have 4 products with different stock dates

 

MayilVahanan

Hi @absekrafi 
Try like below

Aggr(Max(if(not isnull(QTE_STOCK_MP ),DATE_TRANS)),Product) 
or

Max(Aggr(if(not isnull(QTE_STOCK_MP ),DATE_TRANS),Product,DATE_TRANS))

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
absekrafi
Creator III
Creator III
Author

Hi Mayil,

Thank you very much. Your solution worked.

Best regards,

absekrafi