Skip to content
This repository was archived by the owner on Dec 21, 2025. It is now read-only.
This repository was archived by the owner on Dec 21, 2025. It is now read-only.

Identify poor quality products #123

@ferrisoxide

Description

@ferrisoxide

This query:

select count(*) as count,  length(ltrim(gtin, '0')) as gtin_x, length(gtin) as gtin 
from products 
group by length(ltrim(gtin, '0')), length(gtin) 
order by length(ltrim(gtin, '0'));

returns:

count gtin_x gtin
1 0 1
1 1 14
1 3 3
1 4 5
1 4 14
7 5 14
3 6 8
76 6 14
1 7 8
1 7 14
6 8 8
9 8 13
163 8 14
143 9 13
3 9 14
1 10 10
1 10 11
777 10 13
14 10 14
3 11 11
14 11 12
325117 11 13
2474 11 14
34 12 12
267294 12 13
915 12 14
122288 13 13
2911 13 14
4 14 14
1 15 15
2 15 16
1 16 16

Clearly there is a lot of bad data in the production system (products with invalid GTNs). We need to figure out a plan for these records.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions