Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hey there !
my loading script looks like this:
a:
LOAD distinct id_a ,
name_a,
map_id
FROM a.qvd (qvd);
b:
left join
LOAD distinct id_b ,
name_b,
map_id
FROM b.qvd (qvd);
i want to insert a default value into name_b field when the left join didn't match in this method:
if(isnull(name_b),name_a,name_b)
I am doing it in the UI (as a calculated dimension) and it works fine, beside one problem, when the value presented is a_name, it filters name_a value and not name_b field with this value.
for example let's say that in A table, map_id 1 didn't have a match in B table, the values in the UI will be :
id_a=10
name_a='dan'
map_id=1
id_b=null
name_b=null
in the UI i will use the method above and now it will look like this:
id_a=10
name_a='dan'
map_id=1
id_b=null
(new) name_b='dan'
now if i will filter the name_b column to show only 'dan', in the Current selection box i will see: name_a='dan'
what i want to do is use only the value of name_a and not to take the field itself
please help!!
Mor
Try:
Temp:
LOAD distinct id_a,
name_a,
map_id
FROM a.qvd (qvd);
left join (Temp)
LOAD distinct id_b,
name_b,
map_id
FROM b.qvd (qvd);
Result:
noconcatenate
LOAD id_a, name_a, id_b, if(len(trim(name_b))=0,name_a,name_b) as name_b, map_id
RESIDENT Temp;
DROP Table Temp;