Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
Modernize Your QlikView Deployment webinar, Nov. 3rd. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Specialist III
Specialist III

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
Highlighted
Specialist III
Specialist III

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
Highlighted
Specialist III
Specialist III

sorry forgot to attach the QVW file.

Highlighted
Creator III
Creator III

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

Highlighted
Specialist III
Specialist III

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

Highlighted
Creator III
Creator III

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;

Highlighted
Specialist III
Specialist III

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

Highlighted
Specialist III
Specialist III

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