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

IF Then Else with Days Between

Started by jspin, 22 Nov 2023 02:04:21 PM

Previous topic - Next topic

jspin

Hello, I am currently trying to write an IF Then Else statement with days between. I was receiving parsing errors originally, but have alleviated that issue.

The idea of the statment is if a case is unassigned, I want to count the days between todays day and the case creation date to see how long it has been unassigned. However if the case state is assigned i simply want it to return the word assigned.

The below statement returns no errors when verified, but when i try to run the report with this new column i get a message that "the report could not run because a server error occurred." I am new to this, so any insight is very appreciated.

If ([Case State Description] = 'Unassigned') then (days_between (CURRENT_DATE,[Case Create Date])) else ('Assigned')

bus_pass_man

The error, once you get it from the log directory (probably from the xqe directory), will probably be complaining about the mismatch of data types.   The data type of the result of the function of days between will probably be an int of some sort.  They don't mix well with strings.   You will probably need to cast the days between result into a string. 



cognostechie

Quote from: jspin on 22 Nov 2023 02:04:21 PMIf ([Case State Description] = 'Unassigned') then (days_between (CURRENT_DATE,[Case Create Date])) else ('Assigned')

_days_between will return an integer number whereas 'Assigned' is a character so that is a mismatch in datatypes.

jspin