6 Replies Latest reply: Jan 5, 2015 1:58 AM by Mythili Sukumaran

# Hello,

Can someone explain what is being done in the below expression:

"

(Year(REAL_CALL_DATE) * 100000000 + Ceil(Month(REAL_CALL_DATE) / 3) * 1000000 + Month(REAL_CALL_DATE) * 10000)

"

the date (REAL_CALL_DATE) format is :

example: 22/01/2010 00:00:00

• ###### Re: Hello,

I think that this expression generates a 12-character string with first characters giving the year, the next two characters giving the quarter number and the next two characters giving the month number

YYYYQQMM0000

• ###### Re: Hello,

If break this expression you get

=Year(REAL_CALL_DATE) * 100000000  >>   2010 * 100000000   this gives 201000000000

=Ceil(Month(REAL_CALL_DATE) / 3) * 1000000  >> 1 * 1000000   this gives 1000000

=Month(REAL_CALL_DATE) * 10000 >> this gives >> 10000

And final string you get 12 digit value 201001010000

Regards

Anand

• ###### Re: Hello,

It is being generating a new number based the year, quarter and month of REAL_CALL_DATE field. that number won't represent a unique number in the current document or set being analysed.

• ###### Re: Hello,

Hi Mythili,

it converts the date format into a 12 digit string contains year,quarter and month.

22/01/2010 00:00:00 is converted as

201001010000

• ###### Re: Hello,

it will create a number for your date which will work for calculating previous date and next dates using -1 or 1

for Example suppost

you have data like below

201301        (YYYYMM)

201302

201303

201304

201305

201306

201307

201308

201309

201310

201311

201312

201401

in this data all work well but when you calculate next month using Date-1 for 201401 it will return not 201312

so there may be problem when ever there is year change. so over come this type of situation we are implementing

above syntax ( in your query)

using code will generate continuous number and its benificial for scnario like this

hope this help

• ###### Re: Hello,

Thanks evrybody for your comments; but actually my issue is... i want to change the month ranges:

example:

feb = jan 25 to feb 25

mar = feb 25 to mar 25