Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
sarithaallot
Contributor III
Contributor III

how to create column in scripting

Hi Team,

I have source table  like this

 JanFebMar
CAMIRINI17,53215,28017,876
   LAMICS10,1649,17110,520
   LAMICS GEN7,3689,1717,356
EMI ROMA5,8319,17156,582
   LAMICS3,6829,1713,576
   LAMICS GEN2,1499,1712,234
LAZO10,0439,17110,429
   LAMICS7,1329,1717,325
   LAMICS GEN2,9119,1713,104
LOMBA15,6049,17115,816
   LAMICS8,6409,1718,510
   LAMICS GEN6,9649,1717,307
 PIEME+VALLE7,4519,1717,444
   LAMICS4,1569,1714,170
   LAMICS GEN3,2959,1713,274

 

 I want to convert my source table to target table like below  in qlik sense by using scripting. and also in the region field PIEME+VALLE  value i have to name it as PIEME ONLY.

REGIONBRANDJanFebMar
CAMIRINI 17,53215,28017,876
CAMIRINI   LAMICS10,1649,17110,520
CAMIRINI   LAMICS GEN7,3689,1717,356
EMI ROMA 5,8319,17156,582
EMI ROMA   LAMICS3,6829,1713,576
EMI ROMA   LAMICS GEN2,1499,1712,234
LAZO 10,0439,17110,429
LAZO   LAMICS7,1329,1717,325
LAZO   LAMICS GEN2,9119,1713,104
LOMBA 15,6049,17115,816
LOMBA   LAMICS8,6409,1718,510
LOMBA   LAMICS GEN6,9649,1717,307
 PIEME 7,4519,1717,444
 PIEME   LAMICS4,1569,1714,170
 PIEME   LAMICS GEN3,2959,1713,274

 

 

Thanks

1 Reply
StarinieriG
Partner - Specialist
Partner - Specialist

Hi,

 

maybe you could try with something like this:

table:
LOAD
If(Left(REGION,6)<>'LAMICS',SubField(REGION,'+',1),Peek('REGION')) AS REGION,
If(Left(REGION,6)<>'LAMICS',' ',REGION) AS BRAND,
Jan,
Feb,
Mar
FROM ...