
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
how to remove some rows from a table base on where conditions
I have a table as below:
T1:
load * Inline [
id,name
1,grant
2,grant
3,sunny
4,edmond
5,tony
];
I want to remove the rows from which the name is 'grant'.
below code works fine :
T1:
load * where name<>'grant';
load * Inline [
id,name
1,grant
2,grant
3,sunny
4,edmond
5,tony
];
but this is not I want.
now my question starts: ==========>
code to load data cannot be changed :
T1:
load * Inline [
id,name
1,grant
2,grant
3,sunny
4,edmond
5,tony
];
-------------------base line: above code cannot be changed---------------------------------------
now write new code below to remove the rows from which the name is 'grant':
first trial, failed:
T2:
load * resident T1 where name<>'grant';
drop table T1;
second trail, it's ok but not so good, because I have to spend much time to change each column name, (in my work, there are roughtly 70 columns)
T2:
Qualify *;
load * resident T1 where name<>'grant';
drop table T1;
T3:
load T2.id as id, T2.name as name resident T2;
drop table T2;
------------------------end---------------------------
my question: what's the best practice to remove these rows?
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, when working with 2 tables where column count and names are the same, usually Qlik start to treat them as one if not defined otherwise. So your 'first trial' I think was be best try to load table without specific values, but you didn't added 'magical word' 'NoConcatenate'. As Qlik was thinking like this: you load T1 on top you add T2 (it istill one table T1) and you just drop this table. So try like this:
T1:
load * Inline [
id,name
1,grant
2,grant
3,sunny
4,edmond
5,tony];
NoConcatenate
T2:
load *
resident T1
where name<>'grant';
drop table T1;
This way you load T1, you tell Qlik to leave T2 as separate (Not concatenated to T1) table which you create by taking T1 values except 'grant'.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, when working with 2 tables where column count and names are the same, usually Qlik start to treat them as one if not defined otherwise. So your 'first trial' I think was be best try to load table without specific values, but you didn't added 'magical word' 'NoConcatenate'. As Qlik was thinking like this: you load T1 on top you add T2 (it istill one table T1) and you just drop this table. So try like this:
T1:
load * Inline [
id,name
1,grant
2,grant
3,sunny
4,edmond
5,tony];
NoConcatenate
T2:
load *
resident T1
where name<>'grant';
drop table T1;
This way you load T1, you tell Qlik to leave T2 as separate (Not concatenated to T1) table which you create by taking T1 values except 'grant'.
