Hitachi Vantara Pentaho Community Forums
Results 1 to 4 of 4

Thread: Metadata formula has no effect with Metadata Model Editor 5.0.1-1

  1. #1

    Default Metadata formula has no effect with Metadata Model Editor 5.0.1-1

    assetWithFilter - Copy.zip

    Can someone tell me what I might be doing wrong with this absolutely simple Metadata formula?

    I have created a very simple, single-table Metadata model with one table in it pointing to a MySQL database.

    In the Business Table in the Metadata Model I have added a formula:

    Code:
    <CWM:Description xmi.id = 'a980' name = 'formula' body = 'AND ( [BT_F_ACTIVITY_F_ACTIVITY.BC_F_ACTIVITY_ASSETID] = &quot;1234&quot;)' type = 'String'>
    i.e. I only want records with an assetID = '1234'.

    I export that to an xmi file (Attached to this post).

    Then in Report Designer 5.0.1 I create a new blank report, select a metadata datasource and use that xmi file.

    I choose just the assetID as a field to view and then use Preview in the Data Source Editor window to make the query run against my MySQL database.

    But the query I see in the database logs is :
    SELECT DISTINCT BT_F_ACTIVITY_F_ACTIVITY.assetID AS COL0 FROM reporting.f_activity BT_F_ACTIVITY_F_ACTIVITY

    There is no filter added to the query: Why ???
    Last edited by Glen Bremner-Stokes; 11-20-2013 at 06:44 AM.

  2. #2
    Join Date
    Aug 2013
    Posts
    2

    Default

    Did you check the properties : IS the Formula Exact?


    Quote Originally Posted by Glen Bremner-Stokes View Post
    assetWithFilter - Copy.zip

    Can someone tell me what I might be doing wrong with this absolutely simple Metadata formula?

    I have created a very simple, single-table Metadata model with one table in it pointing to a MySQL database.

    In the Business Table in the Metadata Model I have added a formula:

    Code:
    <CWM:Description xmi.id = 'a980' name = 'formula' body = 'AND ( [BT_F_ACTIVITY_F_ACTIVITY.BC_F_ACTIVITY_ASSETID] = &quot;1234&quot;)' type = 'String'>
    i.e. I only want records with an assetID = '1234'.

    I export that to an xmi file (Attached to this post).

    Then in Report Designer 5.0.1 I create a new blank report, select a metadata datasource and use that xmi file.

    I choose just the assetID as a field to view and then use Preview in the Data Source Editor window to make the query run against my MySQL database.

    But the query I see in the database logs is :
    SELECT DISTINCT BT_F_ACTIVITY_F_ACTIVITY.assetID AS COL0 FROM reporting.f_activity BT_F_ACTIVITY_F_ACTIVITY

    There is no filter added to the query: Why ???

  3. #3
    Join Date
    Aug 2013
    Posts
    2

    Default

    I checked your xmi file. You can place the filter on the specific field or in the join with the other business table. I did not have much luck with putting filter directly on the table. You can also try to publish the metadata and see if your filter is apply but running the interactive report using metadata as a source and view sql.
    .

  4. #4

    Default

    It looks like the data constraint can only be applied on the Business Model not on the data tables. Screenshot attached. Add a Data Constraint - Global Constraint.

    Name:  metadata model constraint.jpg
Views: 60
Size:  22.8 KB

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.