Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
YC-Bisley
Contributor
Contributor

Create new field (PeriodID) when loading data

Hell there, I am new to Qlik.

I am loading my Excel data (2 tables) into Qlik.

For my main data tab, I  would like to create a new filed when loading the data (see below, the bolded line is the additional field I would like to add). The second tab is my reference tab. 

The added script worked and data was loaded, when I go to the data manager page,  synchronize the data and load the data again it returns an error message "duplicate derived field"

 

//Main data tab:

[ExistingCustomernewitemsalesRe]:

LOAD

                [Customer Name],

                [Document Number],

                [Date],

                [Item],

                [Display Name],

                [Invoice Total Amount],

                [Division],

                [Trader],

                [Subsidiary],

                [Item Creation Date],

    Month([Date])+Year([Date])*12 as [data.PeriodID]        //new field added manually

   

 FROM [lib://DataFiles/Existing Customer New Item Sale (from 2013).xlsx]

(ooxml, embedded labels, table is ExistingCustomernewitemsalesRe);

 

//Second tab:

[Period]:

LOAD

                [Period],

                [Period ID],

                [FY Year],

                [FY],

                [Month],

                [Year],

                [Mon]

 FROM [lib://DataFiles/Power Query.xlsx]

(ooxml, embedded labels, table is Period);

YCBisley_0-1679373234262.png

 

 

 

1 Solution

Accepted Solutions
Vinay_B
Support
Support

Hi @YC-Bisley 

 

It appears that you loaded data, then unlocked the script, then loaded data again using the data manager, which created second auto-generated section in the script (the locked one). It has a second autoCalendar, and you should not have two calendars with the same name.

 

Since this is for learning purposes and you are new to Qlik, I would propose that you start over and create your app using only the data manager. Explore the associations, edit the tables, then have a look at the data model viewer.

 

After you are confident enough with the data manager and understand how tables are linked, you can move to the script editor, which offers way more flexibility for creating your data model.

If this resolves your query, please click on "Accept as Solution" for confirmation. Thanks!

View solution in original post

2 Replies
fmarvnnt
Partner - Creator III
Partner - Creator III

Have a look of this article:  https://community.qlik.com/t5/New-to-Qlik-Sense/Duplicate-Derived-Field-Qliksense/td-p/1458827.  Will help you to solve.

!

FM

Vinay_B
Support
Support

Hi @YC-Bisley 

 

It appears that you loaded data, then unlocked the script, then loaded data again using the data manager, which created second auto-generated section in the script (the locked one). It has a second autoCalendar, and you should not have two calendars with the same name.

 

Since this is for learning purposes and you are new to Qlik, I would propose that you start over and create your app using only the data manager. Explore the associations, edit the tables, then have a look at the data model viewer.

 

After you are confident enough with the data manager and understand how tables are linked, you can move to the script editor, which offers way more flexibility for creating your data model.

If this resolves your query, please click on "Accept as Solution" for confirmation. Thanks!