Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Power
Contributor
Contributor

Creating new columns in the script, and columns from created ones

Hello,

I am a beginner trying to create columns (dimensions, measures) in the existing tables in the editor script (note: the columns use dimensions from different tables). Then i will require to build columns which are going to be calculated from existing and new ones as well. 

The first question is: how do i code it properly to make it work?

Here is an example of a simple dimensions which i tried to create and add to the table [INPUT_INTERVENTI] (it is made using two dimensions from two different tables, the two tables are being recalled but they have been already loaded in a previous section of the script):

[GENERAL_Discipline]:
Load
*,

[Disciplina],
*
FROM [*]
(ooxml, embedded labels, header is 1 lines, table is GENERAL_Discipline);

[INPUT_INTERVENTI]:
Load
*,
[Task]
FROM [*]
(ooxml, embedded labels, header is 1 lines, table is INPUT_INTERVENTI);

Load

if( [Task] = '123', 'RSB', Disciplina ) as disciplina_int

Resident [INPUT_INTERVENTI];

Drop tables [GENERAL_Discipline],[INPUT_INTERVENTI];

The error which is returned is that it is not capable to find the field [Disciplina].

This being said, is there a best way to create new columns that use columns from different sheets like you do in a xlxs file? Should i use some kind of join between the loaded tables with the original dimensions?

I am trying to learn but i find posts too specific to help me navigate the way of apporaching general best practices. Any suggestions will be greatly appreciated.

0 Replies