2 Replies Latest reply: Jan 12, 2015 5:16 AM by Varsha Shashidhar RSS

    Convert SQL query in Qlikview

      Hi everyone, in these days i'm working on this query in SQL and i've to convert it in qlikview; but it doesn't return the same result when i tested the query in Oracle SQL Developer and Qlikview. So someone can help me to convert the query in the right way??

       

      this is the query in SQL:

      SELECT   GEANNO FILE_YEAR,

               GESEDE FILE_OFFICE,

               GENUME FILE_ID,

               GETIPO FILE_TYPE,

               DECODE ((SELECT   DISTINCT 'A'

                        FROM    invoices inv,invoices_files inv_file

                        WHERE   inv.account_id = 'F1'

                        AND inv_file.invoice_company_id = inv.invoice_company_id

                        AND inv_file.invoice_year = inv.invoice_year

                        AND inv_file.invoice_office = inv.invoice_office

                        AND inv_file.invoice_id = inv.invoice_id

                        AND inv_file.account_id = inv.account_id

                        AND inv_file.comm_responsible = inv.comm_responsible

                        AND inv_file.credit_responsible = inv.credit_responsible

                        AND inv_file.file_year = lavori_in_corso.geanno

                        AND inv_file.file_office = lavori_in_corso.gesede

                        AND inv_file.file_id = lavori_in_corso.genume

                        AND inv_file.file_type = lavori_in_corso.getipo

                        AND inv.invoice_date >(SELECT   last_day(MAX (scarico))

                                               FROM   lavori_in_corso

                                               WHERE   tipo != 'CR')),NULL,SUM (totaler),0) AS AMOUNT_EURO

      FROM   lavori_in_corso

      WHERE   scarico = (SELECT   MAX (scarico)

                         FROM   lavori_in_corso

                         WHERE   tipo != 'CR')

      AND tipo = 'RF' AND coatti IN ('ST', 'RE')

      GROUP BY GEANNO,

               GESEDE,

               GENUME,

               GETIPO