I'm creating a derived date dimension in SAQL and wanted to find out if there was any way to get the year or month (or day or quarter) parts from it? Normally, adding an "_year" to the end of a standard date dimension achieves this:
q = group q by Date_1_year as 'Date1Year', count(q) as 'Count';
But this doesn't seem to work the same way on derived measures (even though the full derived date measure works):
q = foreach q generate toDate(case when 'Date_1_sec_epoch' is not null then 'Date_1_sec_epoch' else 'Date_2_sec_epoch' end) as 'DateToUse'; -- This line doesn't work: q = foreach q generate DateToUse_year as 'DateToUseYear', count(q) as 'Count'; -- This line works: -- q = foreach q generate DateToUse as 'DateToUse', count(q) as 'Count';
Is augmenting the calculated date from a custom formula field in the underlying dataflow the only way to get this right?