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

 

How to display a layout calculation of display first day of the year as tooltip

Started by xyz, 15 Feb 2016 08:46:01 AM

Previous topic - Next topic

xyz

Hi Gurus,

I am using Cognos 10.2.2 and relational model, I have a requirement where my report has to run for two radio options, one is for YTD(Year To Date) and other option is Selected Date Range using date prompts, where user can choose his own dates. I am displaying the tooltip of YTD (year to date) and Selected Date Range options on the mouser hover on a list column header using a span tag. As I am using the calculation of fist day of the year and current_date in the query and also the prompts in the query to display tooltips. Which are making the prompts mandatory, whereas our requirement is we wanted the date prompts to be optional and blank, when we go to Selected Date Range option. To make the date prompts blank, we have used java script.

My tool tip text display where the prompts are mandatory.

YTD tooltip script and data item expressions below:

'<span title="' +[Q_Dummy].[CY Tooltip YTD] + '">'
'</span>'

[CY Tooltip YTD] data item expression - 'Data displayed is based on the'||' '|| [From Date YTD] ||' '||'and'||' '|| [To date YTD] ||' '|| 'date selections'

[From Date YTD] - cast(cast(_make_timestamp (extract(year, current_date), 01, 01), date), varchar(20))
[To date YTD] - cast(cast(current_date as Date) as varchar(20))

Selected Date Range tooltip script and data item expressions below:

'<span title="' +[Q_Svrt_W_Clsd].[CY Tooltip SDR] + '">'
'</span>'

[CY Tooltip SDR] data item expression - 'Data displayed is based on the'||' '||[From Date]||' '||'and'||' '||[To date]||' '||'date selections'

[From Date] - cast(cast(?p_From_Dt?  as Date),varchar(20))
[To date] - cast(cast(?p_To_Dt? as Date) as varchar(20))

As per our requirement to display the tooltip and to make the parameters of 'Selected Date Range' optional, I am writing the expression like below. But I am unable to add the below expression in the span tag as well unable to prefix or suffix any text message.

Layout calculation of first day of year.

_add_days (Today () +Now (), (_day_of_year (Today () +Now ())*-1)+1)

How to have the above expression to have prefix and suffix of text in the expression and use span or other tags in java script to display as a tooltip on mouse hover.

Your suggestions and help will be much appreciated.

Thanks & Regards,
XYZ