Cognos Analytics

Cognos Analytics

Connect, learn, and share with thousands of IBM Cognos Analytics users! 


#Product
#Analytics
#CognosAnalytics
#Analyticstools
#TechXchange Partner
#TechXchange Session
#TechXchange Presenter
#AI
 View Only
  • 1.  Fetch the data for current and 6 months

    Posted 01/16/20 04:30 PM
    Hi,

    I need to add a column to display the data for the current month-1  and column2 to fetch the value of same measure for 6th month back and display in the list report.  I am planning to have 2 queries and one query to fetch the current month data and 2nd query with filter _add_months( current_date , -6 ). Can I join these 2 queries on a dummy data item?? is the approach correct or any other ideas?

    Thanks in advance

    ------------------------------
    jvn cognos
    ------------------------------

    #CognosAnalyticswithWatson


  • 2.  RE: Fetch the data for current and 6 months

    Posted 01/17/20 03:01 AM
    I would have thought it would be easier to have just one query, with two calculated fields:

    if([YourDate] between _add_months(current_date,-1) and current_date) then ([YourMeasure]) else (0)
    if([YourDate] between _add_months(current_date,-6) and _add_days(_add_months(current_date,-1),-1) then ([YourMeasure]) else (0)

    You might want to put a total around those...depends on what you're after. Obviously you also want the filter for 6 months in your query as well.

    If there are any typoes in there blame it on a lack of coffee :)

    ------------------------------
    Chris Turner
    ------------------------------



  • 3.  RE: Fetch the data for current and 6 months

    Posted 01/17/20 10:08 AM

    If you are using Data Modules, you can use Relative Date filters. More details can be found in the following links:

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

    https://www.youtube.com/watch?v=QlJFhXeAbRw



    ------------------------------
    DENNY NAREZNY
    ------------------------------