Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Fieldname Function

Hi all,

I have a table location and I want to find the fieldname as well as field number from the table. How can I do it?

I know the syntax of Fieldname function but don't know  how to and where to place this syntax in the script to make it work.

FieldName(1,'Table1')

Thanks in advance

12 Replies
zebhashmi
Specialist
Specialist

you can pass the result to some field like

ID & FieldName(1,'Table1') as ID2,

Anonymous
Not applicable
Author

I tried let a= NoOfFields(location) in script.

But when still I am not able to see how many fields are there in this table.

Anonymous
Not applicable
Author

I can add this anywhere in the script coz it throwing error is I add this as it is.

zebhashmi
Specialist
Specialist

test:

LOAD

    ID,

    MapSq as MapSq.map

FROM [lib://AttachedFiles/Temp.xlsx]

(ooxml, embedded labels, table is Sheet1);

Tag field MapSq.map with $geomultipolygon;


New:

Load

ID & FieldName(2,'test')as ID1

FROM [lib://AttachedFiles/Temp.xlsx]

(ooxml, embedded labels, table is Sheet1);

zebhashmi
Specialist
Specialist

your table has to be in memory.

Anonymous
Not applicable
Author

So my table name 'Location ' is already used in the script. In this scenario how should I add it in the script.

select * from Location;

zebhashmi
Specialist
Specialist

New:

Load

FieldName(2,'test')as ID1

FROM [lib://AttachedFiles/Temp.xlsx]

(ooxml, embedded labels, table is Sheet1);

Anonymous
Not applicable
Author

But I do not have this excel sheet.

FROM [lib://AttachedFiles/Temp.xlsx]

(ooxml, embedded labels, table is Sheet1);

Anonymous
Not applicable
Author

I did

New:

Load

Fieldname(2,'Location') as ID1

Resident Locationlevels;