Hitachi Vantara Pentaho Community Forums
Results 1 to 7 of 7

Thread: Conditions priorities in MQL query with Report Designer, with Metadata as data source

  1. #1
    Join Date
    Jul 2010
    Posts
    29

    Exclamation Conditions priorities in MQL query with Report Designer, with Metadata as data source

    Hi !

    I have some data in a table, let's name the field "toto" like this : AAA, BBB, CCC, DDD etc.
    I want to have a condition in my MQL query, to take only BBB and CCC for example.

    So, I put one condition with "exactly matches" and BBB in the value field
    and another one with "combine" OR, "exactly matches" and CCC in value field.

    The problem comes when I have to put some conditions with AND, with those OR condition.

    I'm unable to manage priorities, I want the program to do the OR before doing the AND.

    How that is possible ?

    Or, maybe can I put in one single condition the fact that I want those 2 variable BBB and CCC ?

    Thanks

  2. #2
    Join Date
    Jul 2010
    Posts
    29

    Default

    So, no one have this problem ?
    I would at least know if it's a limitation of PRD or if I do it wrong.

  3. #3
    Join Date
    Mar 2003
    Posts
    8,085

    Default

    PRD just uses the metadata system. We do not impose limitation on it - and thus your question would be: Is this a limitation of Pentaho Metadata. And for that you might want to ask in the Metadata forum. Therefore I'm moving that thread there.
    Get the latest news and tips and tricks for Pentaho Reporting at the Pentaho Reporting Blog.

  4. #4
    Join Date
    Jul 2010
    Posts
    29

    Default

    Ok, and so, How do you do to manage priorities when you have some AND AND OR AND OR conditions in your metadata query ?
    Is that supposed to be automatic ?

  5. #5
    Join Date
    Jul 2010
    Posts
    29

    Default

    Well, still no answer so, I had to find a workaround.

    If I have these condition :

    Field A exactly matches "joe"
    AND Field B exactly matches "house"
    OR Field B exactly matches "car"

    Normally, my SQL query should be WHERE A = 'joe' AND (B = 'house' OR B = 'car') but because priorities are not used, it becomes :

    WHERE A = 'joe' AND B = 'house' OR B = 'car' so, SQL interpret first "A = 'joe' AND B = 'house' " and then B = 'car'.

    The workaround :

    Field A exactly matches "joe"
    AND Field B exactly matches "house"
    OR Field A exactly matches "joe"
    AND Field B exactly matches "car"

    But, this can become heavy if there are a lot of conditions.

  6. #6
    Join Date
    Jul 2010
    Posts
    29

    Default

    Am I the only one to have this problem ?

    Or, maybe nobody uses priorities, but, I can't believe that.

  7. #7
    Join Date
    Nov 2008
    Posts
    7

    Default Same problem with conditional priority

    Hey hi X3n0n,

    I am trying to implement the same type of conditional priorities that you mention A AND (B OR C). Did you get something to work for managing this ?
    Please let me know. Thanks in advance.

    Regards,
    Pankaj

Tags for this Thread

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.