Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello Everyone,
I'm trying to use Variable in Where statement which has multiple values.
Can someone pls look into this.
Try these modifications:
Table:
LOAD * INLINE [
FieldA
1
1
2
3
4
];
// Create a temporary table
tmp:
NoConcatenate
Load concat(Distinct FieldA,',') as FieldA
Resident Table;
let vVar1 = peek('FieldA',0,'tmp');
// drop the temporary table
drop table tmp;
Table2:
LOAD * INLINE [
FieldB
1
1
2
12
13
15
16
3
4
];
2:
NoConcatenate
LOAD * Resident Table2
Where
Match(FieldB, $(vVar1));
DROP Table Table, Table2;
Try these modifications:
Table:
LOAD * INLINE [
FieldA
1
1
2
3
4
];
// Create a temporary table
tmp:
NoConcatenate
Load concat(Distinct FieldA,',') as FieldA
Resident Table;
let vVar1 = peek('FieldA',0,'tmp');
// drop the temporary table
drop table tmp;
Table2:
LOAD * INLINE [
FieldB
1
1
2
12
13
15
16
3
4
];
2:
NoConcatenate
LOAD * Resident Table2
Where
Match(FieldB, $(vVar1));
DROP Table Table, Table2;
Try Where match(FieldB,$(vVar1));
Table:
LOAD * INLINE [
FieldA
1
1
2
3
4
];
// Create a temporary table
tmp:
NoConcatenate
Load concat(Distinct FieldA,',') as FieldA
Resident Table;
let vVar1 = peek('FieldA',0,'tmp');
// drop the temporary table
drop table tmp;
Table2:
LOAD * INLINE [
FieldB
1
1
2
12
13
15
16
3
4
];
Table3:
NoConcatenate LOAD * Resident Table2
Where
match(FieldB, $(vVar1));
DROP Table Table2;
Thanks a lot Sunny!
Thanks Gysbert
It worked.
Thanks M G.