Skip to main content
Announcements
See why Qlik was named a Leader in the 2024 Gartner® Magic Quadrant™ for Data Integration Tools for the ninth year in a row: Get the report
cancel
Showing results for 
Search instead for 
Did you mean: 
dario_frimel
Contributor II
Contributor II

Calculated field

Hello,

My recent inquires here led me to change my data model and do some changes in tables, I have used calculated fields to simply add some columns that I required for associations. Anyway, I am currently experiencing issue that tables are not being updated from data source which is live SQL database, and each time I load data it goes loading, creating search indexes and goes without errors but nothing gets updated. I am wondering if calculated field prevents tables from updating from source?

Any input on this is highly welcome, thanks in advance!

Labels (1)
1 Solution

Accepted Solutions
CathyRDuvall
Contributor III
Contributor III

You may want to consider using the preceding load in your Data load editor to create the calculated fields that you need.  If you need to use Dimensions from different tables, best to JOIN tables and use the Resident load to make calculated fields available.  No matter which way you do this, make sure to write LOAD *,   first to make sure that you are continuing to have the rest of the fields available to you.  Good luck.

 

Orders:

LOAD *,

ProductName - Discount as LineSalesAmount

;

SQL SELECT

  OrderID,  Sales,  ProductName,  Discount

FROM [ServerName].TableName

;

 

View solution in original post

8 Replies
CathyRDuvall
Contributor III
Contributor III

You may want to consider using the preceding load in your Data load editor to create the calculated fields that you need.  If you need to use Dimensions from different tables, best to JOIN tables and use the Resident load to make calculated fields available.  No matter which way you do this, make sure to write LOAD *,   first to make sure that you are continuing to have the rest of the fields available to you.  Good luck.

 

Orders:

LOAD *,

ProductName - Discount as LineSalesAmount

;

SQL SELECT

  OrderID,  Sales,  ProductName,  Discount

FROM [ServerName].TableName

;

 

CathyRDuvall
Contributor III
Contributor III

If this worked, please show it as Answered or whatever the new version is calling it. Thanks.
jonathandienst
Partner - Champion III
Partner - Champion III


@dario_frimel wrote: I am wondering if calculated field prevents tables from updating from source?

No. But i suggest you post your load script code.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
dario_frimel
Contributor II
Contributor II
Author

My data is loaded through data manager so the script is automatically generated, I'll try the above solution today/tomorrow and get back at you guys. I'll try to put script after auto generated locked one, to see if it will work.

CathyRDuvall
Contributor III
Contributor III

I would suggest that you unlock the automatically generated code. Open page which says auto generated and press the lock at the top right hand side. This will allow you to edit the code.
dario_frimel
Contributor II
Contributor II
Author

Wouldn't that cause my associations in data manager to be lost?
CathyRDuvall
Contributor III
Contributor III

No. After you unlock the auto generated code you can save it and then go to Data Model and press "Sychronize scripted tables" at the bottom of the screen. Save and Load Data.
Then go back to Data Editor and add the preceding code.
CathyRDuvall
Contributor III
Contributor III

So sorry... please follow the directions above to load data in the Data Editor from now on, not the Data Model.