Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

Announcements
The #1 reason QlikView customers adopt Qlik Sense is a desire for a modern BI experience. Read More
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Creator III
Creator III

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?

Attached is the sample spreadsheet for your reference.


Thanks in advance


Punit

10 Replies
Highlighted
Specialist II
Specialist II

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

Highlighted
Specialist II
Specialist II

find working file

Highlighted
Specialist
Specialist

Did you want this?

Highlighted
Master II
Master II

You can use also INTERVALMATCH function

Highlighted
Specialist II
Specialist II

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')

Highlighted
Creator III
Creator III

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.

Thanks in advance

Punit

Highlighted
Specialist II
Specialist II

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

Highlighted
Master II
Master II

You can use some Variables to store formulas

Highlighted
Contributor II
Contributor II

By using the expression, can we get only last 90 dates data and use this expression on that data.