Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
panipat1990
Creator II
Creator II

Logic

Hi Team,

I Stuck a requirement. i have a table which contain 2 column ..Column 1 is employee code.and column 2 is date of confirm.

Date of confirm field contain a lot of dates.For this i am sharing data..My Requirement is if date of confirm  not equal to monthend.then employee code count on previous month..If Equal to monthend then it be same remain.Show in below table...Header3 is my reasult Field.....suppose my confirm date is 15-07-2016..then it should be count on 30-06-2016.

Note:- in data NULL Means Today

Header 1Header 2Header 3
Employee Code Date of ConfirmResult(New Field)
1NullNull
215-07-201630-06-2016
325-09-201531-08-2015
401-04-201631-03-2016
531-07-201631-07-2016
619-03-201528-02-2015
728-02-201428-02-2014
8NullNull
2 Replies
othniel2014
Contributor III
Contributor III

something like that?

capture_date.png

Table:

LOAD Emp_code,

     [Date Of Confirm],

     if(Floor(num([Date Of Confirm])) = Floor(num(MonthEnd([Date Of Confirm]))), [Date Of Confirm], MonthEnd(AddMonths([Date Of Confirm],-1))) as Result

FROM

[Book1.xlsx]

(ooxml, embedded labels, table is Sheet1);

Edit: if you want to change NULL for today

Table:

LOAD

     Emp_code,

     [Date Of Confirm],

     if([Date Of Confirm] like 'NULL',

          Today(),

          if(Floor(num([Date Of Confirm])) = Floor(num(MonthEnd([Date Of Confirm]))),

               [Date Of Confirm],

               MonthEnd(AddMonths([Date Of Confirm],-1))

          )

     ) as Result

FROM

[Book1.xlsx]

(ooxml, embedded labels, table is Sheet1);

effinty2112
Master
Master

Hi Gourav,

Try this in the script:

Data:

LOAD

Emp_code,

[Date Of Confirm],

Date(MonthEnd(AddMonths([Date Of Confirm],if(Floor(MonthEnd([Date Of Confirm])) = floor([Date Of Confirm]),0,-1))),'MMM-YYYY') as MonthYear;

LOAD

Emp_code,

if( [Date Of Confirm] = 'NULL',Today(),[Date Of Confirm]) as [Date Of Confirm];

LOAD Emp_code,

     [Date Of Confirm]

FROM

Book1.xlsx

(ooxml, embedded labels, table is Sheet1);

Then you can create this straight table:

MonthYear Count(Emp_code)
19073
Jun-20132
Mar-20141
Apr-20143
May-20143
Jun-20141
Jul-201410
Aug-20142
Sep-201417
Oct-201434
Nov-201435
Dec-2014178
Jan-2015130
Feb-2015157
Mar-2015205
Apr-2015240
May-2015110
Jun-2015437
Jul-2015203
Aug-2015295
Sep-2015422
Oct-201598
Nov-2015140
Dec-2015191
Jan-201691
Feb-2016157
Mar-2016125
Apr-2016143
May-201688
Jun-2016118
Jul-201615437

Your spreadsheet has a lot of 'NULL' entries that were interpreted as today and so that is why according to your rules there is such a high count of Emp_code for Jul-2016.

Regards

Andrew