Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

use a field value and not the field itself

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

1 Reply
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

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;



talk is cheap, supply exceeds demand