How do I write a scan that excludes any blanks in the Sector field?

Delaneyslaw
edited July 2025 in s.c.a.n. archives
I want to run a scan that only gives me results if there is an entry (of any kind) in the Sector field, without having to add every possible Sector. How would I create a scan that would be something like:

Group is not 'blank', or Group != "" (neither of those work, btw)

basically, is there a parameter for a blank or null field?

Comments

  • markd
    markd mod
    edited July 2019
    As far as I know, you cannot test for a null or blank value - at least it didn't work when I've tried it either, although that was a while ago, so it may have changed. But here is the code for "any sector", adapted from an old scan of mine:


    //and

    [ // sectors open bracket

    [group is EnergySector]
    or [group is MaterialsSector]
    or [group is IndustrialSector]
    or [group is CyclicalsSector]
    or [group is ConsumerStaplesSector]
    or [group is HealthCareSector]
    or [group is FinancialSector]
    or [group is TechnologySector]
    or [group is CommunicationServicesSector]
    or [group is UtilitiesSector]
    or [group is RealEstateSector]
    ] // sectors close bracket

    "CyclicalsSector" still works, but "ConsumerDiscretionarySector" may also work.

  • @markd thanks for the help. I actually wrote that scan as well, but was a little mystified on why ConsumerDiscretionarySector was not available... wtf?

    Looks like I'll have to do it the hard way... thanks StockCharts...
  • It seems like the programmers have a little housework to do in cleaning up their tables. It may be that someone - probably NOT the programmers - at some point decided "Cyclicals" was a better term for the sector, and then someone decided, no, let's go back to "Consumer Discretionary". Or, it could have been a data vendor decision. In any case, somebody needs to synchronize the data labels and the scan engine labels. Maybe there is already a ticket but it's low priority?
This discussion has been closed.