8 Replies Latest reply: Dec 29, 2014 4:12 PM by Enrique Colomer

# Class function on date

Hi All,

I am having a requirement to group date in the group of 4 (for e.g.), I am achieving this using class function as : Class(Date,4,'x').

But the calculated dimension giving the result in numbers as 41920<=x<41924 (highlighted with purple in screen shot below). Can we convert the result in numbers to Date?

Punit

• ###### Re: Class function on date

Just replace your expression with =date(class(WeekEndingDate,4,'x'))

• ###### Re: Class function on date

find working file

• ###### Re: Class function on date

Did you want this?

• ###### Re: Class function on date

You can use also INTERVALMATCH function

• ###### Re: Class function on date

hi try this

=date(subfield(class(WeekEndingDate,4,'x'),'<= x <',1),'DD/MM/YYYY') &'<= x <' &date(subfield(class(WeekEndingDate,4,'x'),'<= x <',2),'DD/MM/YYYY')

• ###### Re: Class function on date

Hi preminqlik,

Is their a way to replace "x" with the actual date in the middle of the range like :

23/12/2014 <= 26/12/2014 < 27/12/2014 ? as 26/12/2014 is the actual date.

Please let me know if you have implemented.

Punit

• ###### Re: Class function on date

hi there, try this,, you need to playaround with subfield or replace or findoneof()

=date(subfield(class(WeekEndingDate,4,WeekEndingDate),' <= ',1),'DD/MM/YYYY') &' <= ' &

date(subfield(subfield(class(WeekEndingDate,4,WeekEndingDate),' <= ',2),' < ',1),'DD/MM/YYYY')

&

' < '&date(subfield(class(WeekEndingDate,4,WeekEndingDate),' < ',2),'DD/MM/YYYY')

/*

@premhas

• ###### Re: Class function on date

You can use some Variables to store formulas