Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

how to flag month end using peek function

hi May be i am asking a silly question. I would like to flag last date in each month either using peek function or in any other way is script.

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

load Max([Stock Plan Date]) as LastDayMonth, ITEM_ID

Group By ITEM_ID, Year([Stock Plan Date]), Month([Stock Plan Date]);

In this script we have to include month and Year as well otherwise , it will give us the maximum date for each Item...Hope this is correct.

View solution in original post

6 Replies
Anonymous
Not applicable
Author

sorry forgot to attach the QVW file.

Anonymous
Not applicable
Author

if(MonthEnd([Stock Plan Date]) = [Stock Plan Date], 'Y', 'N') as MonthEndFlag

Anonymous
Not applicable
Author

Hi Kozins,

Looks like monthend will give me exact month end i guess. I applied above script, it is N for all the dates. In my data my month end would be sometimes 28th or 29 th, 27 as well. not necessarily 30 or 31....

Anonymous
Not applicable
Author

something lik this:

App:

LOAD [Stock Plan Date] as date,

     AVAIL_INV_QTY,

     ITEM_ID

FROM

(biff, embedded labels, table is Sheet1$);

inner join

load Max([Stock Plan Date]) as LastDayMonth, ITEM_ID

Group By ITEM_ID, Year([Stock Plan Date]), Month([Stock Plan Date]);

App2:

Load *,

if ([Stock Plan Date] = LastDayMonth, 'Y', 'M') as LastDayFlag

Resident App;

Drop Table app;

Anonymous
Not applicable
Author

i was just about to paste the solution. Thanks for your help..i got the same idea..

Anonymous
Not applicable
Author

load Max([Stock Plan Date]) as LastDayMonth, ITEM_ID

Group By ITEM_ID, Year([Stock Plan Date]), Month([Stock Plan Date]);

In this script we have to include month and Year as well otherwise , it will give us the maximum date for each Item...Hope this is correct.