8 Replies Latest reply: Jul 15, 2015 12:59 AM by Mayuri Nandu RSS

    Help in Scripting

    Mayuri Nandu

      Hi,

       

      I want below SQL Query logic in to Qlikview...

       

      select top 3 CV.ValueExcellentDealer,ll.Price,ll.DealerId,D.ID,cv.CarVersionId,ll.Kilometers,Kms,Year(cv.CarYear),Year(ll.MakeYear),D.CityId,cv.CityId,cv.id

      from CarValuations as cv

      join LiveListings as ll on cv.CarVersionId = ll.VersionId and Year(cv.CarYear) = Year(ll.MakeYear) and ll.sellertype = 1

      join Dealers D on D.ID = ll.DealerId

      where ll.Inquiryid = 857654

      and D.CityId = cv.CityId

      and Kms between (ll.Kilometers * 0.9) And (ll.Kilometers * 1.1)

      order by cv.id desc

       

       

       

      SQL OUTPUT:   

      ValueExcellentDealerPriceDealerIdIDCarVersionIdKilometersKmsYearCityIdid
      895009500054885488435590475700020031035822922
      895009500054885488435590476000020031035120179
      895009500054885488435590476000020031035110740

       

       

      Qlikview application has been attached for reference. i am facing challenge to handle kilometer filed for joining..

        • Re: Help in Scripting
          Jemimah Bag

          Hi,

          The qvw shared does not have Inquiryid = 857654.

          Please share the sample raw qvds and the desired output.

          • Re: Help in Scripting
            Mayuri Nandu

            Hi Avinash R,

             

            KMS & Kilometers both are in different tables.

             

            I have two tables. if City, ValuationId, Year & Kilometers are same in both the tables then i want price & value

             

            there is Kilometers filed i have challenge as many times it will match but moreover in both tables kilometers will not match so the below condition to be apply

            Kms between (ll.Kilometers * 0.9) And (ll.Kilometers * 1.1)


            how to do it