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.  Counting data item occurence between a date range

    Posted 09/28/18 08:56 PM
    ​Hi

    How to count data item within a date range

    I have NameId data item and a Creation date data item

    I want to count the number of NameID that is between 2018 and 2017

    So lets say NameID appeared in date range between 2017 and 2018 have three NameID
    The end result will be 3.


    Thanks

    ------------------------------
    Dennis Wong
    ------------------------------

    #CognosAnalyticswithWatson


  • 2.  RE: Counting data item occurence between a date range

    Posted 10/01/18 09:00 AM
    Hello Dennis,

    If I understand your requirement correctly, you can do one of the following.

    If you already have a filter in the query for that date range:
    count(distinct [NameID])

    If you do not want to filter the entire query but just want to count the occurance of Create Date and assuming Created Date is in year format (if not you can convert it):
    case when ([Created Date] between 2017 and 2018)
    then count(distinct [NameID])
    else 0
    end

    Hope this helps.


    ------------------------------
    Shashi Manthena
    ------------------------------