Hitachi Vantara Pentaho Community Forums
Results 1 to 18 of 18

Thread: Problem passing parameters to MDX

  1. #1

    Default Problem passing parameters to MDX

    Hello,

    I have a xaction that:

    1- Gets a dataset with a SQLLookup (OK).
    2- Uses the previous data set to ask the user wich parameter he wants with a "Secure Filter". (Seems to be OK too)
    3 - Uses the previous selected parameter to execute a parametrized MDX. (Seems to be ok all alone, but doesn't work altogether).

    If i set the JPivot component mode to "execute" the output seems to be what i want (it parametrizes the MDX correctly).

    This is the output, MERCADO is my parameter:

    Code:
    model=http://localhost:8080/pentaho/GetMondrianModel?model=SolucionItalfarmaco/EsquemaITF.mondrian.xml
    connection=jdbc/ItalfarmacoProgress
    mdx=select {[Measures].[Recetas]} ON COLUMNS, {[DimProducto].[Mercado].[DIURETICOS]} ON ROWS from [Recetas]
    options=[personal, cube-nav, mdx-edit, sort-conf, spacer, level-style, hide-spans, properties, non-empty, swap-axes, spacer, drill-member, drill-position, drill-replace, drill-thru, spacer, chart, chart-conf, spacer, print-conf, print-pdf, spacer, excel]
    title=Consulta OLAP:
    Mercado=DIURETICOS
    But when I try to use the redirect to JPivot, it fails. It sais something about not finding the OLAP Model, which is not true. I think it has something to do with the output URL from the JPivotComponent, not adding something like " ?Mercado=MYCHOOSE" .

    The url ir generates is:

    http://localhost:8080/pentaho/Pivot?...sulta1.xaction

    Actually, if i add (i have even tried to add it with a JavaScript rule at the end of the xaction) that string to the url manually. Something like this, it works:

    http://localhost:8080/pentaho/Pivot?Mercado=EXPECTORANTES&?solution=SolucionItalfarmaco&path=&action=PruebaITFConsulta1.xaction

    Maybe this i'm trying is something that cannot be done at the moment with pentaho... hope this is not the case.

    I attach my xaction.

    Thanks in advance for any answer. Totally lost here. http://forums.pentaho.org/archived_a...sulta1.xaction
    Javier Giménez
    StrateBI - TodoBI

  2. #2
    dmoran Guest

    Default Re:Problem passing parameters to MDX

    jgiménez,

    Try changing the viewer XML node:
    Code:
    from:
    <viewer>Pivot</viewer>
    
    to:
    <viewer>Pivot?Mercado={Mercado}&</viewer>
    Let me know if this helps,
    Doug

  3. #3

    Default Re:Problem passing parameters to MDX

    OK Doug, thanks.

    It actually helped, but it's not working yet. You solved de redirection problem, but right now, quite weird things are happening.

    The problem seems to be (I modified de Pivot.jsp so the error appears) that no parameter for the query arrives to the jsp (it says query01 is null). But, sometimes it's working, don't really know when... it seems to show the last query it worked...

    Ok this is what i've found:

    - When I execute the xaction with parameter model="execute" for the JPivot component, it shows all the variables OK.

    - When I execute the xaction with any other value, it redirects, now it redirects to the right URL, but the JSP page (Pivot.jsp) seems to not be receiving the query.

    Any ideas?

    I need help here, ¿Might this be some internal pentaho problem maybe?

    Thanks in advance to everybody.
    Javier Giménez
    StrateBI - TodoBI

  4. #4

    Default Re:Problem passing parameters to MDX

    Hi,
    I had a lot of trouble trying to make this work too.
    Why don't you try using <mode> as your mode. In the analysis sample you have two inputs to the xaction that you should keep: mdx and mode.
    There's a post in the forum that says that the pivot calls the action again with a different mode.
    At least that's how I made it work.
    I hope this helps.
    Pablo.

  5. #5
    Join Date
    Jul 2006
    Posts
    8

    Default Re:Problem passing parameters to MDX

    Hi:

    How you form the parameter "mode=execute" in xaction? Or it is part the url??

    I have tried to do it and I not obtain that it works.

    You could send an example to me?


    Sorry for my english

    Jonathan

  6. #6

    Default Re:Problem passing parameters to MDX

    Hello,

    I'm still having trouble. I had already tried to pass <mode> as the mode parameter, but still the call to the jsp fails. It says:

    Code:
    2006-07-11 12:13:56,703 ERROR [com.tonbeller.wcf.component.ComponentTag] trouble creating table01
    javax.servlet.jsp.JspException: query "#{query01}" not found
    	at com.tonbeller.jpivot.table.TableComponentTag.createComponent(TableComponentTag.java:39)
    	at com.tonbeller.wcf.component.ComponentTag.doStartTag(ComponentTag.java:57)
    	at org.apache.jsp.jsp.Pivot_jsp._jspx_meth_jp_table_0(org.apache.jsp.jsp.Pivot_jsp:877)
    	at org.apache.jsp.jsp.Pivot_jsp._jspService(org.apache.jsp.jsp.Pivot_jsp:394)
    	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
    I guess that somehow, the xaction is not passing the mdx parameter correctly to the jsp...

    I attach my .xaction file so anyone can help me or get help from taking a look at it.

    Could you pablo anyway post the xaction that did work for you?

    Best regards. http://forums.pentaho.org/archived_a...ulta1a.xaction

    Post edited by: jagiaz, at: 07/11/2006 06:23
    Javier Giménez
    StrateBI - TodoBI

  7. #7

    Default Re:Problem passing parameters to MDX

    I have a few suggestions:
    1) Why don't you try with a simpler xaction first, leave only the "consulta JPivot" element. I'd also replace the MERCADO parameter for a hardcoded value for testing issues. This way you'll know if the error is in this last action or is somewhere else.
    2) When I define my Data Model I use the relative directory for my solution. For example: now you have http://localhost:8080/pentaho/GetMon...F.mondrian.xml
    I have it under /pentaho-solutions/MySolution/MyPath/myDataModel.mondrian.xml
    I'm attaching my xaction, maybe It will help you.
    Buena suerte!!!!
    Pablo.

    http://forums.pentaho.org/archived_a...aRodeo.xaction

    Post edited by: pablogmuller, at: 07/11/2006 08:18

  8. #8

    Default Re:Problem passing parameters to MDX

    Thanks,
    But i already have simpler jpivot xactions working. I think my problem is only with calling de jsp from a parametrized mdx.

    I might need some help from Doug Moran
    Javier Giménez
    StrateBI - TodoBI

  9. #9
    Join Date
    Jul 2006
    Posts
    8

    Default Re:Problem passing parameters to MDX

    Hola...

    Espero que entiendas español.... my english is very poor

    Para poder filtrar la data de un Pivot, yo desarrolle un componente pentaho que redirecciona al Pivote, pasando el valor seleccionado en el filtro.

    te anexo los .xaction y el codigo del componente.

    espero te sirva

    http://forums.pentaho.org/archived_a...Component.java http://forums.pentaho.org/archived_a...Component.java http://forums.pentaho.org/archived_a...Component.java

  10. #10
    Join Date
    Jul 2006
    Posts
    8

    Default Re:Problem passing parameters to MDX

    Sorry...

    No atache los xaction.

  11. #11
    Join Date
    Jul 2006
    Posts
    8

    Default Re:Problem passing parameters to MDX


  12. #12
    Join Date
    Jul 2006
    Posts
    8

    Default Re:Problem passing parameters to MDX


  13. #13

    Default Re:Problem passing parameters to MDX

    jnelson wrote:
    Thanks for the URLComponent.class, but where do I compile it?
    I used it for my problem ( a Pivot with parameter) but i had this error:

    org.pentaho.component.URLComponent - java.lang.ClassNotFoundException: org.pentaho.component.URLComponent (org.pentaho.core.runtime.RuntimeContext)

    Thanks

    Eleonora

  14. #14
    Join Date
    Jul 2006
    Posts
    8

    Default Re:Problem passing parameters to MDX

    I used Eclipse with Tomcat 5.5+

  15. #15

    Default Re:Problem passing parameters to MDX

    Thanks but I solved my problem by including your url component in my action.

    I have now an other problem. I would like to use SecurFilter with multi-list selection in a Pivot. I know that JFreeReportComponent contains code that takes an array of strings, and converts it to a single comma-separated string, but what about Pivot?

    Thanks
    Lele

    I attach my .xaction

  16. #16

    Default Re:Problem passing parameters to MDX

    Here my .xaction

    Post edited by: eleonoramacaluso, at: 07/19/2006 03:42

  17. #17
    jdixon Guest

    Default Re:Problem passing parameters to MDX

    You are right the pivot and MDX components do not support multi-select parameters. I have added this issue to JIRA:

    http://jira.pentaho.org:8080/jira/browse/ANALYSIS-103

    James

  18. #18
    Join Date
    Oct 2006
    Posts
    29

    Default Re:Problem passing parameters to MDX

    You are right the pivot and MDX components do not support multi-select parameters.
    Hi,
    I found a way of doing it. I have 2 xactions. The first one take the multi parameters list and build an mdx query with it. (see Dynamically Generating a Cross Tab Report, Part 1)

    Then it uses a callExternal component and passes the query to the second xaction.
    The 2nd xaction get the query parameter as an input and pass it to a PivotViewComponent. http://forums.pentaho.org/archived_a...ultiSelect.zip

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.