Sector Name Showing Up As 'Undefined' In Explore Results

Hello Everyone,

I tried running an Explore just a short time ago using an Explore routine that I had used in the past, but although I am getting about 167 lines of results, the Sector column is showing 'Undefined' in every line. In the past I was successfully getting real sector names with this routine. Perhaps a 'setup' I had in the past has been lost or destroyed?

I think I have created the correct definitions for my columns:

AddColumn ( Open,   "Open"  );
AddColumn ( High,   "High"  );
AddColumn ( Low,    "Low"   );
AddColumn ( Close,  "Close" );
AddColumn ( (Volume * 100), "Volume", 1.0 );

AddTextColumn( SectorID(1), "Sector");

Moderator comment: USE THE CODE TAGS. I added them now, but next time posts without code tags will be deleted

Somehow this Explore routine is not giving me sector names even though it did so in the past.

Can you suggest any possibility for this situation occurring? I apologize if I have made some silly mistake. I am not a 'heavyweight' in AFL programming.

Many thanks.

I use this formula to get the ICBID with number and sector name. Maybe it can help you.

AddColumn( Liquidity, "Liquidez",1.2);
AddTextColumn( Nombre, "Nombre",1.2);
AddTextColumn( IcbID(2), "Sector",1.2);

@kwinana4379 I think your code works fine, at least if you have properly set your Filter (I set it to filter=1) and ran your Explore (I ran it on 1 recent day),


You could try some of the code suggested here and see if that makes any difference, otherwise check your data. For example my data does not require it to be multiplied by 10 so your code gives inaccurate results on my database.

First make sure that categories are set up in first place as instructed in manual:

If they are not, and you are using US markets and AmiQuote you can update categories using Tools->Update Symbol list and Categories

Hello Tomasz,

First of all, thank you for your kind and quick response.

In your response to me you suggested that, if I am using US Market data,
then I might follow these steps in AB: Tools > Update US symbol list and
categories. I executed these steps and re-ran the Explore and this time
I got better results. The Sector column showed real sector names for
most tickers; however, a few tickers gave 'Undefined' as the sector
entry. Interestingly, Facebook and Schwab (the brokerage firm) showed

My data source is Reuters (or Equis or Metastock). I am not sure what
they call themselves these days because the company has changed
ownership. The data I use is US Market data. Perhaps my source is the
reason for the occasional 'undefined' entry in the sector column.

In any case, the results are much more improved. Can you suggest any
refinement in my AB setup that would eliminate the 'undefined' entries

Again, many thanks for your help, which is very much appreciated.

Josef Dobrovics

Tomasz Janeczko wrote:


Thank you for your reply. I appreciate your suggestion. It turns out that the reply from Tomasz gave me the best results --- at least so far. The column gave me sector names for the most part, although some entries are still showing 'Undefined' . I will continue working on it.

Thanks again.


Hello Tomasz,

I thank you again for your previous reply. I was able to improve the results in the sector column by using Tools->Update Symbol list and Categories, however, I still get some entries showing 'Undefined' in the sector column. As far as your suggestion to use the link to the manual, I simply do not know what is being said in that page ( It seems a little vague as to how I should set up the categories.

With respect to my data, I am downloading US market data on a nightly basis; I believe it is in Metastock format from Equis International (Reuters). So I am obvioulsy not using AmiQuote.

Can you clarify how I should set up the categories? Thanlk you.


You can do manual adjustments of symbols that have incorrect category using Symbol->Organize assignments