· Apr 16, 2021

DeepSee Pivot tables group by week date display

When creating pivots in DeepSee, there is the ability to group date dimensions by Day, Week, Month, Quarter, Year.  For some of our reporting the Week option is desired.  However the display looks like the image shown below.  Notice the "YYYYW##" formatting.

Is there any ability within DeepSee to modify the display of grouped week dates?  E.g. instead of 2020W14 it could be 03/30/2020-04/05-2020, or even just the start or end date, etc.

Product version: Caché 2015.1
$ZV: 2015.2.3 (Build 855_0_18038)
Discussion (2)2
Log in or sign up to continue

By default, changing the display of the Week members is not available. However, you can create a custom time level by extending %DeepSee.Time.WeekYear and overriding a couple methods. Then you can change your timeFunction value in your cube definition. Here is a sample I put together that was MINIMALLY tested on a newer version than the version you noted here:

 Class CustomTime.WeekRange Extends %DeepSee.Time.WeekYear
{ /// Return the user-visible name of this level.
ClassMethod %GetName() As %String
Quit "WeekRange"
} /// Convert a level key value to a display value.
ClassMethod %KeyToValue(pKey As %Integer, pFormat As %String = "", pOffset As %String = "") As %String
Set tValue = "" Set tSC=..%KeyToBaseRange(pKey,.tStart,.tEnd,pOffset)
Set tValue=$zd(tStart)_"-"_$zd(tEnd-1)
Quit tValue
} /// Convert a $H value to the logical value used for this level.
/// This is used within the computed field logic for properties
/// within a fact table based on this level.<br/>.
/// In this case, we convert $H to an ISO Week: YYYYWnn
ClassMethod %Convert(pTime As %DeepSee.Datatype.dateTime, pTimeOffset As %String = "") As %Integer [ CodeMode = expression ]
} }