If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

GROUPING IS NOT WORKING CORRECTLY (Report Studio 10.2)

Started by gosoccer, 15 Jun 2016 08:28:39 AM

Previous topic - Next topic

gosoccer

Hi, :)

For some reason, the Report is grouping the Date based on Date and Time instead of only Date. So, by each hour, it's grouping
the data. Is there a Format Setting that can be used in the Report or Framework Model to read the Dates as just Date so the
grouping does it's work based on just date.

Thanks a lot for your time!



Lynn

What is the data type for the field upon which the grouping is based? If it is a date with timestamp you can cast it in the report to a date datatype. If it is a string of some sort you'll need to provide more details about how the data in the field is formatted.

gosoccer

Hi Lynn and good morning,

yes, the data type is Timestamp. Would  you mind explaining further or share the cast statement.
So, I would create a calculated item in Report Studio and use something like below but not to character.
The below sentence is for converting to Character. Since it's date already, what could be the code?

For Character Conversion:

cast(Year([DateField]),char(4)) + '-' + cast(month([DateField]),char(2)) + '-' + cast(day([DateField]),char(2))

Since it's date already, what could be the code?

Thx so much.

MFGF

Quote from: gosoccer on 15 Jun 2016 08:28:39 AM
Hi, :)

For some reason, the Report is grouping the Date based on Date and Time instead of only Date. So, by each hour, it's grouping
the data. Is there a Format Setting that can be used in the Report or Framework Model to read the Dates as just Date so the
grouping does it's work based on just date.

Thanks a lot for your time!

Grouping is not working correctly? I'm willing to bet grouping is working exactly as it should. Grouping works based on identical values, and if your dates each have different time parts, they are not identical. What I think you mean is that grouping is not working the way you would like it to work?

Assuming you have dates with time parts in your data, you're going to need to cast them as dates before you group ie cast([your date-time item], date)

Cheers!

MF.
Meep!

gosoccer

Excellent! Thx so much you guys! This works!!!!  :) :) :)

Lynn

Are you familiar with the "tips" section in the expression editor? There is often a decent explanation of the function and some examples as well. The tips for the cast function actually include a sentence that explains quite clearly what you needed.


QuoteWhen you convert a value of type timestamp to type date, the time portion of the timestamp value is ignored.

gosoccer

AHH!! Ok, I'll use that in the future! Thx again!