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

What's Wrong With This Expression?

Started by t0mato, 04 Aug 2020 10:46:12 AM

Previous topic - Next topic

t0mato

Thank you! I think I found it. Both are set to Default.


Quote from: MFGF on 05 Aug 2020 01:39:55 PM
Hi,

Once you have dropped the calculated item into your list, select the list column for the item, and open the Properties pane on the right (it is toggled using the Properties button on the app bar). You should see one property called Detail Aggregation, and another called Summary Aggregation. Can you tell us how both of these are set currently?

MF.

MFGF

Quote from: t0mato on 05 Aug 2020 03:11:48 PM
Thank you! I think I found it. Both are set to Default.

Hi,

This might be your issue. Set them to Total and see if the report runs.

MF.
Meep!

t0mato

Hi and thanks for the response.

I've set them both to total but the report still fails to run and gives the same error. It seems like such a simple ask... If the Days in Step value is greater than 7, simply count it... Is there a problem with an expression calculating based on another one?

Days in Step is not a pre-packaged data item. It is calculated by using a data item called [Step Date] (which is the date in which the employee was put in a particular step) and subtracting that date from today's date. The expression is as follows:

current_date - [Step Date] - which gives a value of how many days the employee has been in the step.

The expression we're trying to implement is supposed to look at how many days each employee has been in a step (Days in Step) and if the value is greater than 7, count it. But whenever I run the report with this expression added to the report, it fails to run...

Quote from: MFGF on 06 Aug 2020 07:24:19 AM
Hi,

This might be your issue. Set them to Total and see if the report runs.

MF.

MFGF

Quote from: t0mato on 06 Aug 2020 08:33:58 AM
Hi and thanks for the response.

I've set them both to total but the report still fails to run and gives the same error. It seems like such a simple ask... If the Days in Step value is greater than 7, simply count it... Is there a problem with an expression calculating based on another one?

Days in Step is not a pre-packaged data item. It is calculated by using a data item called [Step Date] (which is the date in which the employee was put in a particular step) and subtracting that date from today's date. The expression is as follows:

current_date - [Step Date] - which gives a value of how many days the employee has been in the step.

The expression we're trying to implement is supposed to look at how many days each employee has been in a step (Days in Step) and if the value is greater than 7, count it. But whenever I run the report with this expression added to the report, it fails to run...

Hi,

Yikes! The expression current_date - [Step Date] isn't the right thing to do here. There is a function called _days_between() to return the number of days like this:

https://www.ibm.com/support/knowledgecenter/en/SSEP7J_11.0.0/com.ibm.swg.ba.cognos.ca_mdlg.doc/c_btf_days_between.html

Try replacing this with _days_between(current_date, [Step Date])

Cheers!

MF.
Meep!

t0mato

That works! The report now runs. Thank you for all of your help here. Very much appreciated and great learning experience.

Quote from: MFGF on 06 Aug 2020 08:44:25 AM
Hi,

Yikes! The expression current_date - [Step Date] isn't the right thing to do here. There is a function called _days_between() to return the number of days like this:

https://www.ibm.com/support/knowledgecenter/en/SSEP7J_11.0.0/com.ibm.swg.ba.cognos.ca_mdlg.doc/c_btf_days_between.html

Try replacing this with _days_between(current_date, [Step Date])

Cheers!

MF.

MFGF

Quote from: t0mato on 06 Aug 2020 09:13:00 AM
That works! The report now runs. Thank you for all of your help here. Very much appreciated and great learning experience.

That's great news! It's definitely worth asking your Administrator to tweak the settings to allow you to see error messages - if you have issues in future, you can then see what the report is complaining about rather than us having to guess as we did here.

Good luck and happy reporting!

MF.
Meep!