Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Max date of good receipt

Dear Qlik view communnity,

I am new with Qlik view, I need suggestions to resolve this issue.

I'll try to explain:

I have a table with these fields (downloaded from SAP)

N Purchase Order document

Positions

Warehouse movement

Date of Good receipt

The warehouse movement could be

101: entrance

102: writing off

This is an example:

Number of POPositionWarehose movementDate of good receipt Note
44000xxxx00110121/11/2012
44000xxxx00110221/11/2012
44000xxxx00110122/11/2012

I need only the last entrance.

So I tried in this way:

Load [date of good receipt note],

Date(Max([Date of good receipt note]) as [Date Max]

Resident [name of table]

Group by [PO number, Position];

But this doesn't work.

The error is this:

Capture.PNG

Moreover could happens that in the same day I have the entrance of goods, the writing off and the entrance again.

Could you help me please?

Let me know if you need more details.

Thanks

1 Solution

Accepted Solutions
MayilVahanan

HI

When u use aggregate function, you must use group by all other field except the aggregate function field..

Ex:

Load A,B,C,Max(D) as D resident tablename group by A,B,C;

or

u can use like this

tablename:

Load A,B,C,D from table1;

inner join(tablename)

Load A,Max(D) as D resident tablename group by A;

Hope it helps

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

3 Replies
MayilVahanan

HI

When u use aggregate function, you must use group by all other field except the aggregate function field..

Ex:

Load A,B,C,Max(D) as D resident tablename group by A,B,C;

or

u can use like this

tablename:

Load A,B,C,D from table1;

inner join(tablename)

Load A,Max(D) as D resident tablename group by A;

Hope it helps

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

Hi,

thank you for your help.

I used the inner join and now it works.

Can I make another question?

Now I have this:

Capture.PNG

How can I delete the first row, where Date of Good receipt (BLDAT4) is smaller ?

MayilVahanan

Hi

Use Max(BlDat4) in expression..

Hope it helps

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