0 Replies Latest reply: Nov 7, 2017 10:08 AM by Rajesh Santhana Krishnan RSS

    Qlik Sense Data Load Syntax Help - Case Statement + Select Subquery + Calculations

    Rajesh Santhana Krishnan

      Hi,

       

      I need help with the case statement syntax while loading the data in Qlik Sense.

       

      Below is my logic code;

       

      Vendor:

      LOAD "Vendor Name"

      FROM [lib://vendordata.xls];

       

      /// Need help with the syntax for the below code ////

      Table1:

      LOAD *,

      CASE

      WHEN Percentage = 100%

      THEN invoice_line_total

      ELSEIF Percentage = 10% and (IF [Column.Vendor] Match (select [Vendor Name] from Resident Vendor))

      THEN  column a * column b

      ELSEIF Percentage = 10% and (IF [Column.Vendor] Not Match (select [Vendor Name] from Resident Vendor))

      THEN column a * Percentage

      ELSEIF IF [Vendor] Match (select [Vendor Name] from Resident Vendor)

      THEN column a * column b

      ELSE 0

      END as "New Column"

      FROM [lib://Masterdata.qvd]

       

      Drop Table Vendor;