Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Load calculated dimension with fields from two tables in the script

Hi Community,  I have a calculated dimension of: if(leafhdrtxt=[Division Abbreviation],[Division Abbreviation])  The two fields come from two different tables.  How would I try to load this in a script to get a regular field, like: if(leafhdrtxt=[Division Abbreviation],[Division Abbreviation]) as CalcLessField?

5 Replies
Not applicable
Author

It occurs to me to make a join of one of the tables with data from another table. This way you have the fields in one table and you do what you want.

TableA:

SQL Select *

From A;

TableB:

SQL Select *

From B;

Join (TableA)

Load *

Resident TableB;

In this way have in TableA TableB fields.

Not applicable
Author

So when I do the join above, where do I put the calculated dimension?  I tried putting it in the load of the join statement, but it said I was missing the field that is from table B.

Not applicable
Author

After making the join can use all the fields in Table A and make the necessary calculations in Table A because there you have all the fields (Table A and Table B).

A greeting.

PD: pardon my english.

Not applicable
Author

All the tables in this document come from QVDs.  Is there anyway to do the join still?  If so please give me some example syntax.

Ive tried loading the calculated dimension but it always says that the field which is not in the table is missing.

Here is what I have in my document:

TableA:

Load * //not sql select

From A;

TableB:

Load * //not sql select

From B;

Join (TableA)

Load *

Resident TableB;

Not applicable
Author

TableA:

Load * //not sql select

From A;

TableB:

Load * //not sql select

From B;

Join (TableA)

Load *

Resident TableB;

FinalA:

Load

     CalculatedColumn,

     ColumnA1,

     ColumnA2,   

     ......

Resident TableA;

Drop Table TableA;

Is posible that is necesary use reserved word noconcatenate. Ej.

FinalA:

Load

     NOCONCATENATE

     CalculatedColumn,

     ColumnA1,

     ColumnA2,   

     ......

Resident TableA;

Drop Table TableA;