5 Replies Latest reply: May 12, 2015 4:15 AM by Xavier Retaillaud RSS

    Verify the content of one field and replace it under special conditions with another field



      I am confronted with another issue and hope I get another hint from you.


      I am working with Qilk Sense Desktop and I want to optimize my script for data loading.


      I want to add another value "labeltext" (if it is given) in table when the value "ReferenceId_weekly" of the table is not given (Then the value is just "-").


      ===========Here the important part of my script:==============


      LOAD Id as Label_Id,

          "Text" as Labeltext;

      SQL SELECT Id,


      FROM Table.dbo."Labels";


      LOAD "Label_Id",

          "Topic_Id" as TopicId_weekly;

      SQL SELECT "Label_Id",


      FROM Table.dbo.LabelTopics;


      LOAD Id as TopicId_weekly,

          ReferenceId as ReferenceId_weekly,

          CategoryId WHERE CategoryId <= '2'';

      SQL SELECT Id,



      FROM Table.dbo.Topics;


      At the moment there are three tables given. Does this matter? Do I need here a join from my tables?


      I tried it with:

      "IF([ReferenceId_weekly]='-' then ReferenceId_weekly= Labeltext;"


      also with:

      "IF (ReferenceId_weekly <> '-') then ( ReferenceId_weekly = Labeltext );"


      Both had no change in my data.


      At this point I am not sure in which level I have to use this (data load script or in the worksheet itself), can you help?


      Thank you in advance.



      Newbie in Qlik