Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
bramvdpoel
Contributor III
Contributor III

Store into if "value"

Hello,

I want to make different files depending on field value. Is this possible?

Final:

Load*,
If(Exists(Akgid), Akgid, 'Null') as TestMatch
;

Load
VDBArtikel,
EAN,
Merk,
Maat,
Season,
Bruto,
Netto,
Akgid
Resident Ban
;

If TestMatch = 'Null' then store into file1.txt

Else store into file2.txt

 

3 Replies
marcus_malinow
Partner - Specialist III
Partner - Specialist III

This is possible, however there is an issue with your exists clause. Given that all possible values of Akgid already exist in 'Ban', you won't end up with any 'Null' values in your resulting table.

 

Pseudo code to split:

your initial load

then

resident load where TestMatch = 'Null'

Store and drop

resident load where TestMatch <> 'Null'

Store and drop

mohan_1105
Partner - Creator III
Partner - Creator III

Hi,

Sure you can store the data in a different name. Try this,

Tab1:

Load *,

From table1

where match(Field Name. 'Akgid')

Store Tab1 into [Lib: Loaction\Tab1.qvd];

Drop table Tab1;

 

Tab2:

Load *,

From table1

where Field Name <>  'Akgid';

Store Tab2 into [Lib: Loaction\Tab2.qvd];

bramvdpoel
Contributor III
Contributor III
Author

Loading with TestMatch did not work but this gave me the solution though:

Bekend:

Load
VDBArtikel,
EAN,
Merk,
Maat,
Season,
Bruto,
Netto,
Akgid
Resident Ban
Where Exists(Akgid);

Store * from Bekend into vdban.txt (delimiter is ';', txt);

Drop table Bekend;

It works now.

Thanks a lot!