Cognos Analytics

Cognos Analytics

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

 View Only
Expand all | Collapse all

Parsing error in static choice multi select prompt

  • 1.  Parsing error in static choice multi select prompt

    Posted Wed April 01, 2020 02:53 PM
      |   view attached
    Hi,

    I have created static choice prompt without any query associated to it and used function in the expression.

    While validating the report its not showing any errors. But when I run the report getting attached error.

    Please help me how to fix this, we dont have any FM model for our application and we are pulling all columns directly from the package only.

    I have used ​#promptmany('p_Scenario')#  in my data item expression.

    Thanks
    Gopi

    ------------------------------
    Gopi
    ------------------------------

    #CognosAnalyticswithWatson
    #promptmany


  • 2.  RE: Parsing error in static choice multi select prompt

    Posted Wed April 01, 2020 04:49 PM
    I think the promptmany macro is using the semi-colon to separate the values when generating the expression, but when parsing the report specification at run time Cognos is expecting the comma as separator in lists. If this is the reason the report shouldn't give errors when the Scenario paramter contains only one value and not a list of values.

    Maybe also try to change the product and/or content language to a non-english language that uses the semi-colon as list separator.

    Another solution could be to replace the semicolons with commas at runtime using the substitute macro.

    ------------------------------
    Alex Santamarta
    ------------------------------



  • 3.  RE: Parsing error in static choice multi select prompt

    Posted Thu April 02, 2020 04:41 AM
    Hi,

    Are you using DQM?

    You can try the folowing:

    #PROMPTMANY(

    ''p_Scenario'; 

    'token';

    '[default]';

    'set(';

    '';

    ')'

    )#


    With this expression a set is created for the chosen values. So it will result in set ('Actuals'; 'Allocation') instead of ('Actuals'; 'Allocation').


    ------------------------------
    Marloes
    ------------------------------



  • 4.  RE: Parsing error in static choice multi select prompt

    Posted Thu April 02, 2020 05:45 AM
    Hi,

    I am not using DQM, as told earlier no FM model exists in my application, Direct pakage/data model which has all different folders and tables in it.

    I have used your expression still getting parsing error

    #PROMPTMANY(

    ''p_Scenario'; 

    'token';

    '[default]';

    'set(';

    '';

    ')'

    )#





    ------------------------------
    gopinath murthy
    ------------------------------



  • 5.  RE: Parsing error in static choice multi select prompt

    Posted Thu April 02, 2020 09:23 AM
    Hi,

    I have used below expression, still getting parsing error, refer images below

    #promptmany(

    'p_Scenario';

    'token';

    '[default]';

    'set(';

    ';

    ')'

    )#




    Thanks
    Gopi

    ------------------------------
    gopinath murthy
    ------------------------------



  • 6.  RE: Parsing error in static choice multi select prompt

    Posted Thu April 02, 2020 05:33 AM
    Hi,

    Here scenario prompt has static choices multi values not single value. Please give more details on Another solution could be to replace the semicolons with commas at runtime using the substitute macro.

    Thanks
    Gopi

    ------------------------------
    gopinath murthy
    ------------------------------



  • 7.  RE: Parsing error in static choice multi select prompt

    Posted Thu April 02, 2020 06:00 AM
    This expression replaces the semicolons with commas:
    set(#join (",", split(";", promptmany(...)))#)
    but probably you don't need the enclosing set() function if you are using a relational model.

    ------------------------------
    Alex Santamarta
    ------------------------------



  • 8.  RE: Parsing error in static choice multi select prompt

    Posted Thu April 02, 2020 06:09 AM
    Hi,

    Please give complete expression or let me know i can schedule web ex meeting and share with you to discuss and close this issue.

    please share your mail id.

    Thanks
    Gopi

    ------------------------------
    gopinath murthy
    ------------------------------



  • 9.  RE: Parsing error in static choice multi select prompt

    Posted Thu April 02, 2020 09:00 AM
    Hi Alex,

    Please join my web ex to discuss more

    https://ltil.webex.com/meet/gopinath.murthy 

    Thanks
    Gopi

    ------------------------------
    gopinath murthy
    ------------------------------



  • 10.  RE: Parsing error in static choice multi select prompt

    Posted Thu April 02, 2020 09:05 AM
    Hi,

    I have sent you web ex invite on your hot mail, please join now.

    Thanks
    Gopi

    ------------------------------
    gopinath murthy
    ------------------------------



  • 11.  RE: Parsing error in static choice multi select prompt

    Posted Thu April 02, 2020 09:59 AM
    Gopi,

    Add parenthesis around the Promptmany:  (#promptmany('p_Scenario')#)

    Example:

    Select * from table
    where
    table.column in (#promptmany('p_Scenario')#)


    Thanks,
    Vithal


    ------------------------------
    Vithal Madhira
    ------------------------------



  • 12.  RE: Parsing error in static choice multi select prompt

    Posted Thu April 02, 2020 10:35 AM
    Here is a simple report I built using multiple prompts.
    Report using promptmany macro


    ------------------------------
    Vithal Madhira
    ------------------------------



  • 13.  RE: Parsing error in static choice multi select prompt

    Posted Thu April 02, 2020 10:55 AM
    Hi,

    My report is not simple, it has many joins in the queries to get actual result.

    can we connect thru web ex now to discuss on this, please share me ur mail to send web ex details.

    Thanks
    Gopi

    ------------------------------
    gopinath murthy
    ------------------------------



  • 14.  RE: Parsing error in static choice multi select prompt

    Posted Thu April 02, 2020 10:52 AM
    Hi , 

    Tried using above still getting below error.



    ------------------------------
    gopinath murthy
    ------------------------------



  • 15.  RE: Parsing error in static choice multi select prompt

    Posted Mon April 06, 2020 05:57 AM
    Hi All,

    please provide an update on above issue, still i am unable to fix the issue.

    Thanks
    Gopi

    ------------------------------
    gopinath murthy
    ------------------------------



  • 16.  RE: Parsing error in static choice multi select prompt

    Posted Mon April 06, 2020 06:17 AM
    Check if with only one value in the Scenario parameter (for example "Actuals") the report can run without error

    ------------------------------
    Alex Santamarta
    ------------------------------



  • 17.  RE: Parsing error in static choice multi select prompt

    Posted Mon April 06, 2020 06:26 AM
    Hi Alex,

    Single prompt selection, report will run fine without any errors, since we wont use prompt many macro.

    Only issue is with multi select prompt with static choices.

    Thanks
    Gopi

    ------------------------------
    gopinath murthy
    ------------------------------



  • 18.  RE: Parsing error in static choice multi select prompt

    Posted Mon April 06, 2020 07:06 AM
    In which context are you using the promptmany macro?
    Relational, DMR, OLAP, SQL pass through?
    List, Crosstab, ...?
    Is the promptmany data item used in a detail filter,in a slicer, column, column/row node member, ...?
    Cognos version?

    Is it possible for you to post the report specification, or an example report?

    ------------------------------
    Alex Santamarta
    ------------------------------



  • 19.  RE: Parsing error in static choice multi select prompt

    Posted Mon April 06, 2020 08:38 AM
    Hi ALex,

    You can consider as relational model, I am suing list report. Cognos analytics 11 version.

     I cant share the report spec, we can have a meeting to discuss on this.

    Let me know your mail id to send meeting invitation and also the time today to discuss in IST.

    Thanks
    Gopi

    ------------------------------
    gopinath murthy
    ------------------------------