Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

the names of the colunms are numbers

Hi everyone,

 

I have a problem with the names of the columns. Indeed, I created a file delimited in the metadata section to be able to import via this schema data from a delimited files. 

The problem is that my header contain number as names of columns, example of header: name_col_one;name_col_two;2010;2011.

Therefore, at the end of the creation of the metadata, when I choose the option 'Set heading row as column names', I have a '_', for example name_col_one;name_col_two;_010;'_011.

 

I really need to have a correct name of column because the next step is to unpivot my table and I don't want to have this kind of record name_col_one;name_col_two;_010;'value1_from_2010

name_col_one;name_col_two;_010;'value2_from_2010

 

but I want:

name_col_one;name_col_two;2010;'value1_from_2010

name_col_one;name_col_two;2010;'value2_from_2010

 

Thank you in advance

Labels (2)
1 Solution

Accepted Solutions
TRF
Champion II
Champion II

To have a new header, just define it in a tMap and map columns from old schema manually.

View solution in original post

6 Replies
Anonymous
Not applicable
Author

I forgot to say that I have more than one hundred columns, therefore, I cannot use a replace function in the tmap to change the '_' by '2'
TRF
Champion II
Champion II

Having column names starting by number is forbiden because of Java (see namming rules)
Anonymous
Not applicable
Author

Hi,

 

Thank you for your reply.

So, I cannot do anything?

 

I thought about something but I don't know if I can do it (I'm a beginner in Talend)

 

 

It is possible to add "manually" a header to use a Treplace component?

 

For example, after my unpivot, I have these records:

value1_from_column_one;value1_from_column_two;_010;'value1_from_2010

value2_from_column_one;value2_from_column_two;_010;'value2_from_2010

 

I add the "new" header to have this structure:

new_column_one; new_column_two;year;value

value1_from_column_one;value1_from_column_two;_010;'value1_from_2010

value2_from_column_one;value2_from_column_two;_010;'value2_from_2010

 

And after that, I use the Treplace component on the field "year" to replace all '_' by '2'.

 

The question is: How to add the new header?

 

Thank you very much in advance

 

 

TRF
Champion II
Champion II

To have a new header, just define it in a tMap and map columns from old schema manually.
cterenzi
Specialist
Specialist

I have several use cases where the output header format is not allowed by Java constraints.  You can write out the header first, then append your results to the same file.

Anonymous
Not applicable
Author

Hi again,

 

Thank you, it's works with the Tmap. I used the function StringHandling.CHANGE in my "new" header, which has been created in the Tmap as suggested.

 

Thank you again