Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
QlikWorld 2020: Join us May 11 - 14, 2020 in Phoenix, AZ. Register early and save $400. Learn More
dario_frimel
New 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 (2)
1 Solution

Accepted Solutions
CathyRDuvall
New Contributor III

Re: Calculated field

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

;

 

8 Replies
CathyRDuvall
New Contributor III

Re: Calculated field

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
New Contributor III

Re: Calculated field

If this worked, please show it as Answered or whatever the new version is calling it. Thanks.
MVP
MVP

Re: Calculated field


@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
New Contributor II

Re: Calculated field

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
New Contributor III

Re: Calculated field

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
New Contributor II

Re: Calculated field

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

Re: Calculated field

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
New Contributor III

Re: Calculated field

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