Cognos Analytics

Cognos Analytics

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

 View Only
  • 1.  cast (...)

    Posted Fri March 15, 2019 12:03 PM
    Hi,

    I'd like to cast a column of datatype " IntervalDayTimeValue" ([fällig seit]) to integer (smallint). So I did the following:
    cast smallint
    As you can see, the Syntax Editor does not throw any error.
    But when I want to run the Report, the following error appears:

    runtime error
    If I do something like cast(1,0; smallint) --> everything is fine

    Furthermore, I tried the other way round: cast (0; intervalday) (I want to cast the Zero into Interval-datatype that I can compare them)
    --> in this case, I'm not sure about the Syntax because the explanation for the function says that you have to add the type of Interval - but how ? I tried: interval_day,  intervalday etc. but nothing works.

    I'd be glad if anyone can help.

    Thanks in advance,
    Tina




    ------------------------------
    Tina
    ------------------------------

    #CognosAnalyticswithWatson


  • 2.  RE: cast (...)

    Posted Fri March 15, 2019 01:38 PM
    Hi Tina,
    The following is a screen shot from FM, but RS has the same functionality.



    In the example : to get a zero value interval day to second, you specify:
    0 00:00:00.000000000 day to second

    That will give a literal value that you can compare to columns of the same datatype.
    // Henk


    ------------------------------
    HENK CAZEMIER
    ------------------------------



  • 3.  RE: cast (...)

    Posted Wed March 20, 2019 06:23 AM
    Hi Henk,

    thank you very much for the quick reply. 

    I tried your proposal but unfortunately, it didn't work :-/ I guess it was because of the Dataelement I wanted to cast [fällig seit]. 

    But I found another solution - I set a predefined filter and used the range-function. 

    Kind regards,
    Tina

    ------------------------------
    Tina Noack
    ------------------------------