Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Team,
I have source table like this
| Jan | Feb | Mar | |
| CAMIRINI | 17,532 | 15,280 | 17,876 |
| LAMICS | 10,164 | 9,171 | 10,520 |
| LAMICS GEN | 7,368 | 9,171 | 7,356 |
| EMI ROMA | 5,831 | 9,171 | 56,582 |
| LAMICS | 3,682 | 9,171 | 3,576 |
| LAMICS GEN | 2,149 | 9,171 | 2,234 |
| LAZO | 10,043 | 9,171 | 10,429 |
| LAMICS | 7,132 | 9,171 | 7,325 |
| LAMICS GEN | 2,911 | 9,171 | 3,104 |
| LOMBA | 15,604 | 9,171 | 15,816 |
| LAMICS | 8,640 | 9,171 | 8,510 |
| LAMICS GEN | 6,964 | 9,171 | 7,307 |
| PIEME+VALLE | 7,451 | 9,171 | 7,444 |
| LAMICS | 4,156 | 9,171 | 4,170 |
| LAMICS GEN | 3,295 | 9,171 | 3,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.
| REGION | BRAND | Jan | Feb | Mar |
| CAMIRINI | 17,532 | 15,280 | 17,876 | |
| CAMIRINI | LAMICS | 10,164 | 9,171 | 10,520 |
| CAMIRINI | LAMICS GEN | 7,368 | 9,171 | 7,356 |
| EMI ROMA | 5,831 | 9,171 | 56,582 | |
| EMI ROMA | LAMICS | 3,682 | 9,171 | 3,576 |
| EMI ROMA | LAMICS GEN | 2,149 | 9,171 | 2,234 |
| LAZO | 10,043 | 9,171 | 10,429 | |
| LAZO | LAMICS | 7,132 | 9,171 | 7,325 |
| LAZO | LAMICS GEN | 2,911 | 9,171 | 3,104 |
| LOMBA | 15,604 | 9,171 | 15,816 | |
| LOMBA | LAMICS | 8,640 | 9,171 | 8,510 |
| LOMBA | LAMICS GEN | 6,964 | 9,171 | 7,307 |
| PIEME | 7,451 | 9,171 | 7,444 | |
| PIEME | LAMICS | 4,156 | 9,171 | 4,170 |
| PIEME | LAMICS GEN | 3,295 | 9,171 | 3,274 |
Thanks
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 ...