6 Replies Latest reply: Oct 30, 2012 1:31 PM by mateus.viola RSS

    Problem with loops

      Hi,

       

      Good day!

       

      I'm developing a google maps in my qlikview file but when I was running the script, the qlikview showed a problem with loops.

      Follow below the Table View and script:

       

      untitled.JPG

      Please note below the script:

       

      Flights:

      LOAD [Region (1)],

          [Company (2)],

          Department,

          [Traveller´s Name] as Name,

          [Travel Purpose],

          [Type of Transport (3)],

          [Probability of Occurrence (4)],

          [Estimated Date of Departure],

          date(monthstart([Estimated Date of Departure]),'MMM-YYYY') as MonthYear,

          [Departure City (and Country)],

          [Arrival City (and Country)],

          [# Nights],

          [Ticket Estimated Cost in USD (5)],

          Comments

      FROM [\\Fsbritj01\gg-britj-pcc$\Budget Adm\BUDGET ADM 2012\Travel Plan- Budget Viaens.xls] (biff, header is 9 lines, embedded labels, table is Flights$);

       

      DepartureCity:

      LOAD * INLINE [

      ID, "Departure City (and Country)", latitude, longitude, Valor

      1, 'Itajaí/Brazil', '-26,908258', '-48,662602', 10

      2, 'Fortaleza/Brazil', '-3,718394', '-38,543395', 10

      3, 'Buenos Aires/ Argentina', '-34,603723', '-58,381593', 10

      4, 'Montevideo/Uruguai', '-34,883611', '-56,181944', 10

      5, 'Navegantes/Brazil', '-26,899395', '-48,655280', 10

      6, 'Porto Alegre/Brasil', '-30,027704', '-51,228735', 10

      7, 'Recife/Brazil', '-8,054277', '-34,881256', 10

      8, 'Rio de Janeiro/ Brazil', '-22,903539', '-43,209587', 10

      9, 'Rio Grande/Brazil', '-32,031941', '-52,099607', 10

      10, 'Santos/Brazil', '-23,961836', '-46,332247', 10

      11, 'São Paulo/ Brazil', '-23,548943', '-46,638818', 10

      12, 'Assunção/Paraguai', '-25,282197', '-57,635100', 10

      13, 'Durban/South Africa', '-29,857876', '31,027581', 10

      14, 'Imbituba/Brazil', '-28,240543', '-48,670300', 10

      15, 'Paranagua/Brazil', '-25,520469', '-48,509486', 10

      16, 'Santiago/ Chile', '-33,469120', '-70,641997', 10

      17, 'São Francisco do Sul/Brazil', '-26,242177', '-48,635647', 10

      ];

       

      ArrivalCity:

      LOAD * INLINE [

      ID, "Arrival City (and Country)", latitude, longitude, Valor

      1, 'Itajaí/Brazil', '-26,908258', '-48,662602', 10

      2, 'Fortaleza/Brazil', '-3,718394', '-38,543395', 10

      3, 'Buenos Aires/ Argentina', '-34,603723', '-58,381593', 10

      4, 'Montevideo/Uruguai', '-34,883611', '-56,181944', 10

      5, 'Navegantes/Brazil', '-26,899395', '-48,655280', 10

      6, 'Porto Alegre/Brasil', '-30,027704', '-51,228735', 10

      7, 'Recife/Brazil', '-8,054277', '-34,881256', 10

      8, 'Rio de Janeiro/ Brazil', '-22,903539', '-43,209587', 10

      9, 'Rio Grande/Brazil', '-32,031941', '-52,099607', 10

      10, 'Santos/Brazil', '-23,961836', '-46,332247', 10

      11, 'São Paulo/ Brazil', '-23,548943', '-46,638818', 10

      12, 'Assunção/Paraguai', '-25,282197', '-57,635100', 10

      13, 'Durban/South Africa', '-29,857876', '31,027581', 10

      14, 'Imbituba/Brazil', '-28,240543', '-48,670300', 10

      15, 'Paranagua/Brazil', '-25,520469', '-48,509486', 10

      16, 'Santiago/ Chile', '-33,469120', '-70,641997', 10

      17, 'São Francisco do Sul/Brazil', '-26,242177', '-48,635647', 10

       

      I appreciate your help

       

      Many thanks!!!!

       

      Mateus Viola.

        • Re: Problem with loops
          mayilvahanan ramasamy

          HI

           

          Try like this

           

          ArrivalCity:

          LOAD * INLINE [

          ID, "Arrival City (and Country)", Arrivallatitude, Arrivallongitude, ArrivalValor

          ..

          ];

            • Re: Problem with loops

              Hi,

              Thanks for your reply, but unfortunately the error persists.

               

              Would you have some other suggestion?

                • Re: Problem with loops
                  mayilvahanan ramasamy

                  Hi

                   

                  Did you try like this?

                   

                  Flights:

                  LOAD [Region (1)],

                      [Company (2)],

                      Department,

                      [Traveller´s Name] as Name,

                      [Travel Purpose],

                      [Type of Transport (3)],

                      [Probability of Occurrence (4)],

                      [Estimated Date of Departure],

                      date(monthstart([Estimated Date of Departure]),'MMM-YYYY') as MonthYear,

                      [Departure City (and Country)],

                      [Arrival City (and Country)],

                      [# Nights],

                      [Ticket Estimated Cost in USD (5)],

                      Comments

                  FROM [\\Fsbritj01\gg-britj-pcc$\Budget Adm\BUDGET ADM 2012\Travel Plan- Budget Viaens.xls] (biff, header is 9 lines, embedded labels, table is Flights$);

                   

                  DepartureCity:

                  LOAD * INLINE [

                  ID, "Departure City (and Country)", latitude, longitude, Valor

                  1, 'Itajaí/Brazil', '-26,908258', '-48,662602', 10

                  2, 'Fortaleza/Brazil', '-3,718394', '-38,543395', 10

                  3, 'Buenos Aires/ Argentina', '-34,603723', '-58,381593', 10

                  4, 'Montevideo/Uruguai', '-34,883611', '-56,181944', 10

                  5, 'Navegantes/Brazil', '-26,899395', '-48,655280', 10

                  6, 'Porto Alegre/Brasil', '-30,027704', '-51,228735', 10

                  7, 'Recife/Brazil', '-8,054277', '-34,881256', 10

                  8, 'Rio de Janeiro/ Brazil', '-22,903539', '-43,209587', 10

                  9, 'Rio Grande/Brazil', '-32,031941', '-52,099607', 10

                  10, 'Santos/Brazil', '-23,961836', '-46,332247', 10

                  11, 'São Paulo/ Brazil', '-23,548943', '-46,638818', 10

                  12, 'Assunção/Paraguai', '-25,282197', '-57,635100', 10

                  13, 'Durban/South Africa', '-29,857876', '31,027581', 10

                  14, 'Imbituba/Brazil', '-28,240543', '-48,670300', 10

                  15, 'Paranagua/Brazil', '-25,520469', '-48,509486', 10

                  16, 'Santiago/ Chile', '-33,469120', '-70,641997', 10

                  17, 'São Francisco do Sul/Brazil', '-26,242177', '-48,635647', 10

                  ];

                   

                  ArrivalCity:

                  LOAD * INLINE [

                  ID, "Arrival City (and Country)", Arrivallatitude, Arrivallongitude, ArrivalValor

                  1, 'Itajaí/Brazil', '-26,908258', '-48,662602', 10

                  2, 'Fortaleza/Brazil', '-3,718394', '-38,543395', 10

                  3, 'Buenos Aires/ Argentina', '-34,603723', '-58,381593', 10

                  4, 'Montevideo/Uruguai', '-34,883611', '-56,181944', 10

                  5, 'Navegantes/Brazil', '-26,899395', '-48,655280', 10

                  6, 'Porto Alegre/Brasil', '-30,027704', '-51,228735', 10

                  7, 'Recife/Brazil', '-8,054277', '-34,881256', 10

                  8, 'Rio de Janeiro/ Brazil', '-22,903539', '-43,209587', 10

                  9, 'Rio Grande/Brazil', '-32,031941', '-52,099607', 10

                  10, 'Santos/Brazil', '-23,961836', '-46,332247', 10

                  11, 'São Paulo/ Brazil', '-23,548943', '-46,638818', 10

                  12, 'Assunção/Paraguai', '-25,282197', '-57,635100', 10

                  13, 'Durban/South Africa', '-29,857876', '31,027581', 10

                  14, 'Imbituba/Brazil', '-28,240543', '-48,670300', 10

                  15, 'Paranagua/Brazil', '-25,520469', '-48,509486', 10

                  16, 'Santiago/ Chile', '-33,469120', '-70,641997', 10

                  17, 'São Francisco do Sul/Brazil', '-26,242177', '-48,635647', 10

                  ];

                   

                   

                  This script get error? Can you please tel the error?

                    • Re: Problem with loops

                      Hi,

                       

                      When I run the script, the Qlikview shows the message below:

                       

                      "One or more loops have been detected in your database structure. Loops may cause ambiguous results and should therefore be avoided. QlikView will cut the loop(s) by setting one or more tables as loosely coupled. Settings for loosely coupled tables can be modified after script execution in the tables page of the document properties dialog."

                       

                      Could you help me?

                        • Re: Problem with loops
                          mayilvahanan ramasamy

                          HI

                           

                          Sorry.. Try like this, so flights n DepartureCity join each other.

                          Flights:

                          LOAD [Region (1)],

                              [Company (2)],

                              Department,

                              [Traveller´s Name] as Name,

                              [Travel Purpose],

                              [Type of Transport (3)],

                              [Probability of Occurrence (4)],

                              [Estimated Date of Departure],

                              date(monthstart([Estimated Date of Departure]),'MMM-YYYY') as MonthYear,

                              [Departure City (and Country)],

                              [Arrival City (and Country)],

                              [# Nights],

                              [Ticket Estimated Cost in USD (5)],

                              Comments

                          FROM [\\Fsbritj01\gg-britj-pcc$\Budget Adm\BUDGET ADM 2012\Travel Plan- Budget Viaens.xls] (biff, header is 9 lines, embedded labels, table is Flights$);

                           

                          Join(Flights)

                          DepartureCity:

                          LOAD * INLINE [

                          ID, "Departure City (and Country)", latitude, longitude, Valor

                          1, 'Itajaí/Brazil', '-26,908258', '-48,662602', 10

                          2, 'Fortaleza/Brazil', '-3,718394', '-38,543395', 10

                          3, 'Buenos Aires/ Argentina', '-34,603723', '-58,381593', 10

                          4, 'Montevideo/Uruguai', '-34,883611', '-56,181944', 10

                          5, 'Navegantes/Brazil', '-26,899395', '-48,655280', 10

                          6, 'Porto Alegre/Brasil', '-30,027704', '-51,228735', 10

                          7, 'Recife/Brazil', '-8,054277', '-34,881256', 10

                          8, 'Rio de Janeiro/ Brazil', '-22,903539', '-43,209587', 10

                          9, 'Rio Grande/Brazil', '-32,031941', '-52,099607', 10

                          10, 'Santos/Brazil', '-23,961836', '-46,332247', 10

                          11, 'São Paulo/ Brazil', '-23,548943', '-46,638818', 10

                          12, 'Assunção/Paraguai', '-25,282197', '-57,635100', 10

                          13, 'Durban/South Africa', '-29,857876', '31,027581', 10

                          14, 'Imbituba/Brazil', '-28,240543', '-48,670300', 10

                          15, 'Paranagua/Brazil', '-25,520469', '-48,509486', 10

                          16, 'Santiago/ Chile', '-33,469120', '-70,641997', 10

                          17, 'São Francisco do Sul/Brazil', '-26,242177', '-48,635647', 10

                          ];

                           

                          Hope it helps