COGNOiSe.com - The IBM Cognos Community

IBM Cognos Analytics Platform => Cognos Analytics => Reporting => Topic started by: dougp on 13 Apr 2022 02:14:08 PM

Title: Display day of week names
Post by: dougp on 13 Apr 2022 02:14:08 PM
It seems like there would be a function that produces day names or abbreviations, but I can't find it.  Is there a better way to do this?


case _day_of_week ([C].[namespace].[subject].[Date_], 1)
when 1 then 'Mon'
when 2 then 'Tue'
when 3 then 'Wed'
when 4 then 'Thu'
when 5 then 'Fri'
when 6 then 'Sat'
when 7 then 'Sun'
end
Title: Re: Display day of week names
Post by: MFGF on 13 Apr 2022 02:31:42 PM
Quote from: dougp on 13 Apr 2022 02:14:08 PM
It seems like there would be a function that produces day names or abbreviations, but I can't find it.  Is there a better way to do this?


case _day_of_week ([C].[namespace].[subject].[Date_], 1)
when 1 then 'Mon'
when 2 then 'Tue'
when 3 then 'Wed'
when 4 then 'Thu'
when 5 then 'Fri'
when 6 then 'Sat'
when 7 then 'Sun'
end


Hi Doug,

Can you just use formatting for this? Just use the full date, and use the data format property to suppress eras, years, months and days, and set the "Display weekdays" option to "Short name"

Is this an option for you?

Cheers!

MF.
Title: Re: Display day of week names
Post by: dougp on 13 Apr 2022 02:54:56 PM
It's for a chart that should show 7 data points.
Title: Re: Display day of week names
Post by: MFGF on 13 Apr 2022 03:12:34 PM
Quote from: dougp on 13 Apr 2022 02:54:56 PM
It's for a chart that should show 7 data points.

Ah, in that case, no dice. Your case statement is the best option.

Cheers!

MF.