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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

If statement in filter

Hi everybody,

I've got two tables like these:

Table A

VALUES     DESCRIPTIONS

value1        descriptionA;

value2        descriptionB;

value3        descriptionC;

Table B    

VALUES     DESCRIPTIONS

value1        descriptionD;

value3        descriptionE;

I would like to have the description contained in Table B if there's the code in it and if not I'd like to have the description contained in Table A. To do that I used this statement:

If(IsNull(TABLE B.DESCRIPTIONS),TABLE A.DESCRIPTIONS, TABLE B.DESCRIPTIONS)

If I use that statement in a tree map chart I get what I want, but if I use it in a filter (in order to filter my fields by the description) I only get a blank list.

What should I do?

Thanks a lot in advance !!!

1 Solution

Accepted Solutions
CELAMBARASAN
Partner - Champion
Partner - Champion

Hi

Don't use conditional expression in filter that will not be perfect in sometimes

May be you can load the table b as Mapping load and use Apply map for this.

May be the script will looks like this

TableB:

Load * from TableB.qvd(qvd);

TableBMapping:

Mapping Load TableB.Values, TableB.Descriptions Resident TableB;

TableA:

Load *, ApplyMap('TableBMapping', TableA.VALUES, TableA.DESCRIPTIONS) as TableA.DescriptionsModified

Resident TableA.qvd(qvd);

Regards

Celambarasan

View solution in original post

2 Replies
CELAMBARASAN
Partner - Champion
Partner - Champion

Hi

Don't use conditional expression in filter that will not be perfect in sometimes

May be you can load the table b as Mapping load and use Apply map for this.

May be the script will looks like this

TableB:

Load * from TableB.qvd(qvd);

TableBMapping:

Mapping Load TableB.Values, TableB.Descriptions Resident TableB;

TableA:

Load *, ApplyMap('TableBMapping', TableA.VALUES, TableA.DESCRIPTIONS) as TableA.DescriptionsModified

Resident TableA.qvd(qvd);

Regards

Celambarasan

Not applicable
Author

Thanks a lot for your help! It works perfectly!!