IBM Support

YTD total comparison

Troubleshooting


Problem

Product: Impromptu Version: 7.0 Build: 554 Platform: Windows-all Description: How can I create a report that calculates the total sale for this year from the beginning of the year until today. Also, Total Sale for same period last year. year always starts on January 1 Solution: One sub report for each year YTD total. You will need to make use of sub-reports to be able to implement this calculation. The main report calculates the year to date total for current year. The filter should look like this: Date between 2002-01-01 and today() Where Date is the date column in your report and Today () is an Impromptu built in function that returns todays date. You can also use Oracle's now function instead. The sub-report calculates the YTD total for previous year. The filter should look like this: Date between 2001-01-01 and (datetime-to-date(add-years(Today(), -1))) add-years: Is a built in Impromptu function that given a certain date, it adds or subtracts a certain number of years as per value passed. Datetime-to-date: Is an Impromptu built in function that changes the format returned by add-years from datetime to date.

[{"Product":{"code":"SSTQPQ","label":"IBM Cognos Series 7 PowerPlay"},"Business Unit":{"code":"BU048","label":"IBM Software"},"Component":"Impromptu","Platform":[{"code":"PF025","label":"Platform Independent"},{"code":"PF033","label":"Windows"}],"Version":"Cognos 8 BI Report Studio 8.2;Impromptu 7.0","Edition":"","Line of Business":{"code":"LOB76","label":"Data Platform"}},{"Product":{"code":"SSEP7J","label":"Cognos Business Intelligence"},"Business Unit":{"code":"BU048","label":"IBM Software"},"Component":"Report Studio","Platform":[{"code":"","label":""}],"Version":"","Edition":"","Line of Business":{"code":"LOB76","label":"Data Platform"}},{"Product":{"code":"SSTQPQ","label":"IBM Cognos Series 7 PowerPlay"},"Business Unit":{"code":"BU048","label":"IBM Software"},"Component":"Impromptu","Platform":[{"code":"","label":""}],"Version":"","Edition":"","Line of Business":{"code":"LOB76","label":"Data Platform"}},{"Product":{"code":"SS6G84","label":"IBM Cognos Analytics on Cloud"},"Business Unit":{"code":"BU048","label":"IBM Software"},"Component":" ","Platform":[{"code":"","label":""}],"Version":"","Edition":"","Line of Business":{"code":"LOB76","label":"Data Platform"}}]

Log InLog in to view more of this document

This document has the abstract of a technical article that is available to authorized users once you have logged on. Please use Log in button above to access the full document. After log in, if you do not have the right authorization for this document, there will be instructions on what to do next.

Historical Number

108773

Document Information

Modified date:
09 May 2025

UID

swg21337010