5 Replies Latest reply: Nov 9, 2018 5:27 AM by Anil Samineni RSS

    Insert SQL Query in Data load editor

    Riken Ardian

      Hi, please help with my issue.

       

      I had this DB with lots of tables such as :
      'list_item' table

      'list_item_storage' table

      'list_item_tx' table

      'list_warehouse' table

      and so on.

       

      Currently I'm using Smart data load in Qlik Sense to create report, but now i have to insert data with this kinds of SQL Query :

      SELECT t2.tx_id, t2.storage_id, t2.tx_date, t2.end_qty, t3.item_id, t4.item_name, t5.location_name

      FROM (SELECT storage_id, MAX(tx_date) AS tx_date FROM web_pcm.list_item_tx GROUP BY storage_id) t1

      INNER JOIN web_pcm.list_item_tx t2 ON t1.storage_id = t2.storage_id AND t1.tx_date = t2.tx_date

      LEFT JOIN web_pcm.list_item_storage t3 ON t2.storage_id = t3.storage_id

      LEFT JOIN web_pcm.list_item t4 ON t3.item_id = t4.item_id

      LEFT JOIN web_pcm.list_warehouse t5 ON t3.location_id = t5.location_id

       

      From Smart data load table selection is ended in Auto-generated section. I tried to insert my Query on Data load editor in Main tab, but it keeps telling me this error.

       

      The following error occurred:

      Connector reply error: SQL##f - SqlState: 3D000, ErrorCode: 1046, ErrorMsg: [ma-3.0.3][10.1.35-MariaDB]No database selected

       

      Data has not been loaded. Please correct the error and try loading again.



      How do I insert that SQL Query and create a report on it? Do I still need to use Smart data load along with SQL Query, or just need the SQL Query to load the data I need?