Skip to main content Skip to complementary content

Deleting a profiling report from the data quality data mart

If you want to delete some of the profiling reports in the data mart to ease the management of the reports, you can use SQL queries in the Data Explorer perspective in Talend Studio.

Before you begin

  • You have defined a data mart for the reports.
  • You have executed some reports in Talend Studio connected to the data mart where you have saved report results.
  • You have the report identifier from the data mart. If you do not have the report identifier, see the following procedure.

Getting a report identifier from the data mart

Before deleting a profiling report, you need the report identifier.

Procedure

  1. Open the Data Explorer perspective in Talend Studio.
  2. In the Connections view, right-click a database connection and select New SQL Editor.

    • If you want the identifier of one report, enter the following SQL query in the editor:
      use <datamart database name>;
      /* get report UUID */ 
      select  REP_UUID, REP_LABEL  from tdq_analysis where REP_LABEL = '<report name>';
      Information noteImportant: Use the exact data mart and report names in the query.
    • If you want the identifier of several reports, enter the following SQL query in the editor:
      use talend_dq61;
      /* get report UUID */ 
      select  REP_UUID, REP_LABEL  from tdq_analysis where REP_LABEL like 'c%' 

      In this example, you want to access the talend_dq61 data mart and get the identifiers of all the reports which start with the letter c .

  3. Execute the SQL query.

Results

The data explorer outputs the report names and their identifiers, three in this example.
Report names and identifiers in the Data Explorer.

What to do next

Use the identifiers in another SQL query to delete the reports.

Deleting a report from the data mart

Procedure

  1. In the Data Explorer perspective, open an editor.
  2. Enter the following SQL query in the editor and execute it in the order shown below:
    use talend_dq61;
    /*must execute the sql in this order*/
    /*1. delete data from tdq_indicator_value table*/
    delete from tdq_indicator_value where analysis_pk in (select an_pk from tdq_analysis where rep_uuid in ('_EuRp8Ey8EeWI7MB95QH5HA', '_cabpUUzUEeW6FuESwuuXqA'));
    /*2. delete data from tdq_overview_indvalue table*/
    delete from tdq_overview_indvalue where an_pk in (select an_pk from tdq_analysis where rep_uuid in ('_EuRp8Ey8EeWI7MB95QH5HA', '_cabpUUzUEeW6FuESwuuXqA'));
    /*3. delete from tdq_set_indvalue table*/
    delete from tdq_set_indvalue where an_pk in (select an_pk from tdq_analysis where rep_uuid in ('_EuRp8Ey8EeWI7MB95QH5HA', '_cabpUUzUEeW6FuESwuuXqA'));
    /*4. delete from tdq_analyzed_set table*/
    delete from tdq_analyzed_set where match_ind_pk in(select m_pk from tdq_match_indvalue where analysis_pk in (select an_pk from tdq_analysis where rep_uuid in ('_EuRp8Ey8EeWI7MB95QH5HA', '_cabpUUzUEeW6FuESwuuXqA')));
    /*5. delete from tdq_match_indvalue table*/
    delete from tdq_match_indvalue where analysis_pk in (select an_pk from tdq_analysis where rep_uuid in ('_EuRp8Ey8EeWI7MB95QH5HA', '_cabpUUzUEeW6FuESwuuXqA'));
    /*6. delete from tdq_table_analyzed_set table*/
    delete from tdq_table_analyzed_set where an_pk in (select an_pk from tdq_analysis where rep_uuid in ('_EuRp8Ey8EeWI7MB95QH5HA', '_cabpUUzUEeW6FuESwuuXqA'));
    /*7. delete from tdq_analysis table*/
    delete from tdq_analysis where rep_uuid in ('_EuRp8Ey8EeWI7MB95QH5HA', '_cabpUUzUEeW6FuESwuuXqA');

    In this example, you want to delete the two reports which have the identifiers _EuRp8Ey8EeWI7MB95QH5HA and _cabpUUzUEeW6FuESwuuXqA from the talend_dq61 data mart.

  3. Execute the SQL query to delete the reports.
  4. To make sure the reports have been deleted, in an SQL editor, re-run the following SQL query:
    use talend_talend_dq61;
    /* get report UUID */ 
    select  REP_UUID, REP_LABEL  from tdq_analysis where REP_LABEL like 'c%'

Results

The two reports which have the identifiers _EuRp8Ey8EeWI7MB95QH5HA and _cabpUUzUEeW6FuESwuuXqA have been deleted from the data mart.

The reports have been deleted from the TDQ_ANALYSIS table. All facts (analysis results) related to these reports have been deleted from the fact tables.

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – please let us know!