2 Replies Latest reply: Jul 3, 2015 9:03 AM by Gysbert Wassenaar RSS

    Alternative to doing multiple table loads to create fields?

    Matt Maino

      I am interested in figuring out a way to create fields out of my initial data load and then use those created fields to create new fields without needing to do multiple table loads. Below is an example of what I'm talking about:

       

      Tmp:

      Load *,

       

      if(field1 = 1, 'value1',

      if(field1 = 2, 'value2',

      if(field3 = 3, 'value3'))) as created_field

       

      Resident Master

      Drop Table Master;

      Rename table tmp to Master;

       

      Tmp:

      Load *,

       

      if(created_field = 'value1', 'x'

      if(created_field = 'value2', 'y'

      if(created_field = 'value3', 'z'))) as created_field_2

       

      Resident Master

      Drop Table Master;

      Rename table tmp to Master;

       

      I have done this so many times that my qlikview script is very slow to load. Is there an alternative?