5 Replies Latest reply: May 16, 2017 9:40 AM by LAURENT CLOATRE RSS

    Requête dans Qlik View avec le mot WITH ne fonctionne pas

    Requet Philippe

      Bonjour,

       

      J'ai réalisé cette requête sous SQL :

      WITH ventes AS (SELECT        Reservations.re_numero AS IDSession, InscriptionsLignes.il_montantLigneHT AS VenteSession

                                           FROM            Reservations INNER JOIN

                                                                     InscriptionsEntetes ON Reservations.re_numero = InscriptionsEntetes.in_reservation INNER JOIN

                                                                     InscriptionsLignes ON InscriptionsEntetes.in_numero = InscriptionsLignes.il_inscription INNER JOIN

                                                                     InscriptionsTiers ON InscriptionsEntetes.in_numero = InscriptionsTiers.it_inscription AND InscriptionsLignes.il_inscription = InscriptionsTiers.it_inscription

                                           WHERE        (InscriptionsTiers.it_typeRattachement = '01') AND (Reservations.re_etat <> 3) AND (Reservations.re_annulation = 0) AND (InscriptionsEntetes.in_Etat <> '4')), couts AS

          (SELECT        Reservations_1.re_numero AS IDSession, ReservationsProduits.rp_montantPrevu AS Couts

            FROM            Reservations AS Reservations_1 INNER JOIN

                                      ReservationsProduits ON Reservations_1.re_numero = ReservationsProduits.rp_numeroReservation

            WHERE        (Reservations_1.re_etat <> 3) AND (Reservations_1.re_annulation = 0)), tot_ventes AS

          (SELECT        IDSession, SUM(VenteSession) AS ventes

            FROM            ventes AS ventes_1

            GROUP BY IDSession), tot_couts AS

          (SELECT        IDSession, SUM(Couts) AS couts

            FROM            couts AS couts_1

            GROUP BY IDSession)

          SELECT        tvn.IDSession, tvn.ventes, tct.couts

           FROM            tot_ventes AS tvn INNER JOIN

                                    tot_couts AS tct ON tvn.IDSession = tct.IDSession

       

      Elle fonctionne parfaitement, mais lorsque je la mets dans Qlik, toutes les lignes apparaissent en rouge et si je lance le chargement, j'ai le message d'erreur suivant :

      Unknown statement: WITH: >>>>>>WITH<<<<<< ventes AS (SELECT


      Quelqu'un saurait-il m'aider et me dire comment je peux me sortir de cette situation ?

      Je vous remercie par avance.