Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
RobertB07
Contributor II
Contributor II

Adding new fields to a table based on previous added fields

I am loading a csv called "exportcsvde" in to Qlik sense, this file has a field called userAccountControl with a numeric value. I want to create several new fields based on previously created new fields.  I added a list with the fieldnames i need to create and the formula.

userAccountControl
UAC_IND0if(userAccountControl>=67108864,1,0)
UAC_VAL0if(UAC_IND0=1,[userAccountControl]-67108864,[userAccountControl])
UAC_IND1if(UAC_VAL0>=16777216,1,0)
UAC_VAL1if(UAC_IND1=1,[UAC_VAL0]-16777216,[UAC_VAL0])
UAC_IND2if(UAC_VAL1>=8388608,1,0)
UAC_VAL2if(UAC_IND2=1,[UAC_VAL1]-8388608,[UAC_VAL1])
UAC_IND3if(UAC_VAL2>=4194304,1,0)
UAC_VAL3if(UAC_IND3=1,[UAC_VAL2]-4194304,[UAC_VAL2])
UAC_IND4if(UAC_VAL3>=2097152,1,0)
UAC_VAL4if(UAC_IND4=1,[UAC_VAL3]-2097152,[UAC_VAL3])
UAC_IND5if(UAC_VAL4>=1048576,1,0)
UAC_VAL5if(UAC_IND5=1,[UAC_VAL4]-1048576,[UAC_VAL4])
UAC_IND6if(UAC_VAL5>=524288,1,0)
UAC_VAL6if(UAC_IND6=1,[UAC_VAL5]-524288,[UAC_VAL5])
UAC_IND7if(UAC_VAL6>=262144,1,0)
UAC_VAL7if(UAC_IND7=1,[UAC_VAL6]-262144,[UAC_VAL6])
UAC_IND8if(UAC_VAL7>=131072,1,0)
UAC_VAL8if(UAC_IND8=1,[UAC_VAL7]-131072,[UAC_VAL7])
UAC_IND9if(UAC_VAL8>=65536,1,0)
UAC_VAL9if(UAC_IND9=1,[UAC_VAL8]-65536,[UAC_VAL8])
UAC_IND10if(UAC_VAL9>=8192,1,0)
UAC_VAL10if(UAC_IND10=1,[UAC_VAL9]-8192,[UAC_VAL9])
UAC_IND11if(UAC_VAL10>=4096,1,0)
UAC_VAL11if(UAC_IND11=1,[UAC_VAL10]-4096,[UAC_VAL10])
UAC_IND12if(UAC_VAL11>=2048,1,0)
UAC_VAL12if(UAC_IND12=1,[UAC_VAL11]-2048,[UAC_VAL11])
UAC_IND13if(UAC_VAL12>=512,1,0)
UAC_VAL13if(UAC_IND13=1,[UAC_VAL12]-512,[UAC_VAL12])
UAC_IND14if(UAC_VAL13>=256,1,0)
UAC_VAL14if(UAC_IND14=1,[UAC_VAL13]-256,[UAC_VAL13])
UAC_IND15if(UAC_VAL14>=128,1,0)
UAC_VAL15if(UAC_IND15=1,[UAC_VAL14]-128,[UAC_VAL14])
UAC_IND16if(UAC_VAL15>=64,1,0)
UAC_VAL16if(UAC_IND16=1,[UAC_VAL15]-64,[UAC_VAL15])
UAC_IND17if(UAC_VAL16>=32,1,0)
UAC_VAL17if(UAC_IND17=1,[UAC_VAL16]-32,[UAC_VAL16])
UAC_IND18if(UAC_VAL17>=16,1,0)
UAC_VAL18if(UAC_IND18=1,[UAC_VAL17]-16,[UAC_VAL17])
UAC_IND19if(UAC_VAL18>=8,1,0)
UAC_VAL19if(UAC_IND19=1,[UAC_VAL18]-8,[UAC_VAL18])
UAC_IND20if(UAC_VAL19>=2,1,0)
UAC_VAL20if(UAC_IND20=1,[UAC_VAL19]-2,[UAC_VAL19])
UAC_IND21if(UAC_VAL20>=1,1,0)
UAC_VAL21if(UAC_IND21=1,[UAC_VAL20]-1,[UAC_VAL20])

 

If i add these as a calculated field in the data-manager is see the script code later in the data load editor in the auto generated section. But i see  the each created field after the one that refers to the field userAccountControl from the csv file doesnt refers to the previous created field but contains the formula from the previous fields:

RobertB07_0-1623132724488.png

Is there a way to refer to a created field? or what am i doing wrong? Because i think this isn't really efficient. 

 

 

1 Solution

Accepted Solutions
marcus_sommer

Probably you will need to do it directly within the script because the automatic "magic" is until now quite limited - in regard to the possibilities which you could use if you creates the script yourself. What do you looking for is called:

Preceding Load - Qlik Community - 1469534

- Marcus

View solution in original post

1 Reply
marcus_sommer

Probably you will need to do it directly within the script because the automatic "magic" is until now quite limited - in regard to the possibilities which you could use if you creates the script yourself. What do you looking for is called:

Preceding Load - Qlik Community - 1469534

- Marcus