Number Formatting thousand separator

Hi there i am running metabase 0.43.4 with using the databricks driver:

I have spent several hours but i cant seem to make my numbers look nice on tables and cards. They have many digits and no thousand separator.
image

I have changed the field formatting options and types in admin -> data models -> table -> field.

what am i doing wrong? It works fine on the sample data.

1 Like

Hi @jaoe
Those values are strings. Metabase cannot handle string formatting. You'll need to change your columns to return numeric values.
Latest release is 0.44.4: https://github.com/metabase/metabase/releases/latest

I am having the same issue. Changing the format to either a double, integer or decimal did not change the outcome. We also use version number 0.43.4 and see the following screen while wanting to change the number format on question level:

1 Like

@aga_devries Then it's not a numeric column being returned. Upgrade to latest release.

1 Like

Hi upgraded to latest and made sure that i get number in original schema: type/Float. Still does not work. Is this due to the custom connector?

@jaoe Most likely, you'll need to post the field metadata, so I can understand what is going on.
Get the metadata by going to the URL /api/field/123, where 123 is the field ID, which you can find by going to Admin > Data Model > (db) > (table) > (field) :gear: > the URL should be .../123/general

@flamber Thanks for your reply. I've seen the thread and this is what the field metadata for our revenue field looks like:

{
  "description": null,
  "database_type": "decimal(38,18)",
  "semantic_type": "type/Currency",
  "table_id": 99,
  "coercion_strategy": null,
  "table": {
    "description": null,
    "entity_type": "entity/TransactionTable",
    "schema": "dna_prod",
    "db": {
      "description": null,
      "features": [
        "full-join",
        "basic-aggregations",
        "standard-deviation-aggregations",
        "expression-aggregations",
        "percentile-aggregations",
        "foreign-keys",
        "right-join",
        "left-join",
        "native-parameters",
        "nested-queries",
        "expressions",
        "regex",
        "case-sensitivity-string-filter-options",
        "binning",
        "inner-join",
        "advanced-math-expressions"
      ],
      "cache_field_values_schedule": "0 0 22 * * ? *",
      "timezone": null,
      "auto_run_queries": true,
      "metadata_sync_schedule": "0 0 10 * * ? *",
      "name": "dwh_production",
      "settings": null,
      "caveats": null,
      "creator_id": 1,
      "is_full_sync": false,
      "updated_at": "2022-09-29T14:58:25.609506Z",
      "cache_ttl": null,
      "is_sample": false,
      "id": 2,
      "is_on_demand": false,
      "options": null,
      "engine": "sparksql-databricks",
      "initial_sync_status": "complete",
      "refingerprint": null,
      "created_at": "2022-09-12T08:16:19.140481Z",
      "points_of_interest": null
    },
    "show_in_getting_started": false,
    "name": "order_statistics",
    "caveats": null,
    "updated_at": "2022-10-03T09:55:52.636717Z",
    "active": true,
    "id": 99,
    "db_id": 2,
    "visibility_type": null,
    "field_order": "database",
    "initial_sync_status": "complete",
    "display_name": "Order Statistics",
    "created_at": "2022-10-01T10:00:04.751963Z",
    "points_of_interest": null
  },
  "name": "revenue",
  "fingerprint_version": 5,
  "has_field_values": "none",
  "settings": {
    "show_mini_bar": true,
    "currency": "EUR",
    "currency_in_header": false,
    "prefix": "€",
    "number_separators": ",."
  },
  "caveats": null,
  "fk_target_field_id": null,
  "dimensions": [],
  "updated_at": "2022-10-18T15:06:08.452604Z",
  "custom_position": 0,
  "effective_type": "type/Decimal",
  "active": true,
  "nfc_path": null,
  "parent_id": null,
  "id": 1861,
  "last_analyzed": "2022-10-03T09:55:52.796704Z",
  "position": 9,
  "visibility_type": "normal",
  "preview_display": true,
  "display_name": "Revenue",
  "database_position": 9,
  "name_field": null,
  "fingerprint": {
    "global": {
      "distinct-count": 6880,
      "nil%": 0
    },
    "type": {
      "type/Number": {
        "min": 5.95,
        "q1": 83.35941884250322,
        "q3": 488.52951218498464,
        "max": 25008.97,
        "sd": 703.256384132089,
        "avg": 411.43334200000004
      }
    }
  },
  "created_at": "2022-10-01T10:00:07.187227Z",
  "base_type": "type/Decimal",
  "points_of_interest": null
}

As far as I know this is correct, right?

Hi @flamber , here is the metadata of the field:

{
   "description":null,
   "database_type":"double",
   "semantic_type":null,
   "table_id":105,
   "coercion_strategy":null,
   "table":{
      "description":null,
      "entity_type":"entity/GenericTable",
      "schema":"prod_dwh",
      "db":{
         "description":null,
         "features":[
            "full-join",
            "basic-aggregations",
            "standard-deviation-aggregations",
            "expression-aggregations",
            "percentile-aggregations",
            "foreign-keys",
            "right-join",
            "left-join",
            "native-parameters",
            "nested-queries",
            "expressions",
            "regex",
            "case-sensitivity-string-filter-options",
            "binning",
            "inner-join",
            "advanced-math-expressions"
         ],
         "cache_field_values_schedule":"0 0 12 * * ? *",
         "timezone":null,
         "auto_run_queries":true,
         "metadata_sync_schedule":"0 22 * * * ? *",
         "name":"Databricks",
         "settings":null,
         "caveats":null,
         "creator_id":1,
         "is_full_sync":true,
         "updated_at":"2022-10-18T14:49:18.141",
         "cache_ttl":null,
         "is_sample":false,
         "id":2,
         "is_on_demand":false,
         "options":null,
         "engine":"sparksql-databricks",
         "initial_sync_status":"complete",
         "refingerprint":null,
         "created_at":"2022-10-18T14:47:21.759",
         "points_of_interest":null
      },
      "show_in_getting_started":false,
      "name":"fct_order_progress",
      "caveats":null,
      "updated_at":"2022-10-18T14:52:26.963",
      "active":true,
      "id":105,
      "db_id":2,
      "visibility_type":null,
      "field_order":"database",
      "initial_sync_status":"complete",
      "display_name":"Fct Order Progress",
      "created_at":"2022-10-18T14:47:23.916",
      "points_of_interest":null
   },
   "name":"amount_dkk",
   "fingerprint_version":5,
   "has_field_values":"none",
   "settings":{
      "scale":1
   },
   "caveats":null,
   "fk_target_field_id":null,
   "dimensions":[
      
   ],
   "updated_at":"2022-10-18T14:58:00.491",
   "custom_position":0,
   "effective_type":"type/Float",
   "active":true,
   "nfc_path":null,
   "parent_id":null,
   "id":928,
   "last_analyzed":"2022-10-18T14:52:26.968",
   "position":8,
   "visibility_type":"normal",
   "preview_display":true,
   "display_name":"Amount Dkk",
   "database_position":8,
   "name_field":null,
   "fingerprint":{
      "global":{
         "distinct-count":805,
         "nil%":0.0
      },
      "type":{
         "type/Number":{
            "min":0.0,
            "q1":52380.89941130451,
            "q3":402765.07808785944,
            "max":1.7974579617189983E8,
            "sd":9355133.921446817,
            "avg":1806516.6189543833
         }
      }
   },
   "created_at":"2022-10-18T14:48:49.28",
   "base_type":"type/Float",
   "points_of_interest":null
}

This doesn't make much sense.

Everything looks correct on the field, specifically database_type, semantic_type, effective_type, base_type and fingerprint.
When there's problems with those, then it can be corrected by following the alternative steps in https://github.com/metabase/metabase/issues/18074

Try checking the response in your browser developer Network-tab when running a question. It's the types that are interesting.

Are you using driver version 1.4.0?
Have you tried creating an issue on the driver repo to see if others have this problem? It seems like the problem is somewhere in the driver, since you're both using that.

1 Like