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

Trouble with conditional styles and dates *Newbe*

Started by bakkeb, 08 Apr 2015 08:11:41 AM

Previous topic - Next topic

bakkeb

I have a table with a column named [Rotation Tour Date]
Date format is YYYY/MM/DD.
I am trying to highlight/color fill any dates that are less than 6 months or 182 days from todays date in RED. 
Any dates that are greater than 6 months or 182 days can stay white or unchanged.
Any cells that contain blanks could be filled orange.

I am not sure what information to provide here to help so please let me know what I need to include to help.  :-[

Sorry for the newbe post  :-\
Thank you for your time and support in advance.
Blair
Cognos Report Studio Ver. 10.2

BigChris

Hi Blair,

I think what you probably need is an Age column - you can calculate it as _days_between([Rotation Tour Date],current_date). Once you've done that you should be able to put a conditional format together.

Lynn

Quote from: bakkeb on 08 Apr 2015 08:11:41 AM
I have a table with a column named [Rotation Tour Date]
Date format is YYYY/MM/DD.
I am trying to highlight/color fill any dates that are less than 6 months or 182 days from todays date in RED. 
Any dates that are greater than 6 months or 182 days can stay white or unchanged.
Any cells that contain blanks could be filled orange.

I am not sure what information to provide here to help so please let me know what I need to include to help.  :-[

Sorry for the newbe post  :-\
Thank you for your time and support in advance.
Blair
Cognos Report Studio Ver. 10.2


A quick skim of the Etiquette post sticky will help you understand the types of things we need to know in order to provide the best help to you.
http://www.cognoise.com/index.php/topic,24030.0.html

In your case the first big thing is whether your source is relational or dimensional. Answers tend to be dramatically different between these two styles of reporting. If you aren't sure then it is probably relational, but maybe we need an entry in the FAQ sticky to help new people understand which is which.

If it is relational, then I'd also want to know if that date is truly a date data type or if it is a character string formatted to look like a date. Hopefully the former.

So IF your source is relational and IF the data type of your date is truly a date, then you can use an advanced conditional style to format as you desire. The link below explains conditional styles a bit more thoroughly, or refer to the user guide.

The _days_between() function is the one you will want to use to determine if the date in question is less than 182 days from the current date. I can never recall off hand the order of the parameters, but something like this might be the expression for your red shading (or else swap the two dates in the expression if I did it backwards):

_days_between( [Your Query Item Date], current_date ) < 182

If your date really is a date data type then it won't be storing a blank, but rather a null. Your expression for that one might be something like this:

[Your Query Item Date] is null

http://www-01.ibm.com/support/knowledgecenter/SSEP7J_8.4.0/com.ibm.swg.im.cognos.ug_rptstd_fin.8.4.0.doc/ug_rptstd_fin_id3759cr_rptstd_modrep_highlight_data_con.html%23cr_rptstd_modrep_highlight_data_cond_styles

Hope this puts you on the right path. Otherwise you'll need to post back with more details to get a correct answer.

BigChris


Lynn