Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I'm pretty new to qlik and trying some things but can't seem to fix the following problem:
I want to load a new column [Prijs] to the table.
If the value in column [Prijsind] = 'AAB' then it should load [Brutoprijs] Else it should load [Dubbel].
'MP':
Directory;
LOAD
[@2:4] as Voorloper,
text([@5:26]) as Artikelcode,
[@30:52] as TecDoc,
[@58:81] as EAN,
[@91:125] as Omschrijving,
[@237:248] as Bruto1,
[@249:250] as Bruto2,
[@251:253] as Prijsind,
[@257:259] as ExtArtID,
[@260:270] as [min aantal],
[@274:280] as [aantal verpakking],
[@317:320] as btw,
[@321:334] as verwijderings,
[@2:4] & [@257:259] as Match,
[@237:250] as Brutoprijs,
[@237:250]*2 as Dubbel
FROM
[G:\Temp\mp_all_rai_NL.txt]
(fix, codepage is 1252, no labels);
Can anyone help me?
Thanks in advance!
You can add this by a load on load:
'MP':
Directory;
Load
*,
if([Prijsind] = 'AAB', [Brutoprijs] , [Dubbel]) as YourColumn
;
LOAD
[@2:4] as Voorloper,
text([@5:26]) as Artikelcode,
[@30:52] as TecDoc,
[@58:81] as EAN,
[@91:125] as Omschrijving,
[@237:248] as Bruto1,
[@249:250] as Bruto2,
[@251:253] as Prijsind,
[@257:259] as ExtArtID,
[@260:270] as [min aantal],
[@274:280] as [aantal verpakking],
[@317:320] as btw,
[@321:334] as verwijderings,
[@2:4] & [@257:259] as Match,
[@237:250] as Brutoprijs,
[@237:250]*2 as Dubbel
FROM
[G:\Temp\mp_all_rai_NL.txt]
(fix, codepage is 1252, no labels);
Exactly as u said it,
if([Prijsind] = 'AAB', [Brutoprijs] , [Dubbel]) as YourColumn
You can add this by a load on load:
'MP':
Directory;
Load
*,
if([Prijsind] = 'AAB', [Brutoprijs] , [Dubbel]) as YourColumn
;
LOAD
[@2:4] as Voorloper,
text([@5:26]) as Artikelcode,
[@30:52] as TecDoc,
[@58:81] as EAN,
[@91:125] as Omschrijving,
[@237:248] as Bruto1,
[@249:250] as Bruto2,
[@251:253] as Prijsind,
[@257:259] as ExtArtID,
[@260:270] as [min aantal],
[@274:280] as [aantal verpakking],
[@317:320] as btw,
[@321:334] as verwijderings,
[@2:4] & [@257:259] as Match,
[@237:250] as Brutoprijs,
[@237:250]*2 as Dubbel
FROM
[G:\Temp\mp_all_rai_NL.txt]
(fix, codepage is 1252, no labels);
Isn't this the same response I gave? I'll assume u havn't seen mine 🙂
Your right (your formula) ; but for somebody new to Qlik it may be unclear how to add it in the script.
Great! Thanks a lot for the whole script, otherwise i didn't know where to put it!