Skip to content

Example Calculated Columns

Data in dashboards can be augmented with calculated columns. Each dataset will contain a section for calculated columns. Calculated columns can be written and modified with PostgreSQL-flavored SQL.

In order to view and edit metrics and calculated expressions, perform the following steps:

  1. Sign into plaidcloud.com and navigate to dashboards
  2. From within visualize.plaidcloud.com, navigate to Data > Datasets
  3. Search for a dataset to view or modify
  4. Modify the dataset by hovering over the edit button beneath Actions
COUNT(*)
min("MyColumnName")
max("MyColumnName")

Coalesce (useful for Converting Nulls to 0.0, for Instance)

Section titled “Coalesce (useful for Converting Nulls to 0.0, for Instance)”
coalesce("BaselineCost",0.0)
substring("PERIOD",6,2)
CAST("YEAR" AS integer)-1
concat("Biller Entity" , ' ', "Country_biller")
to_char("date_created", 'YYYY-mm-dd')
left("period",4)

divide, with a hack for avoiding DIV/0 errors

sum("so_infull")/(count(*)+0.00001)
CASE WHEN "Field_A"= 'Foo' THEN max(coalesce("Value_A",0.0)) - max(coalesce("Value_B",0.0)) END
CASE WHEN "sol_otif_pod_missing" = 1 THEN
'POD is missing.'
ELSE
'POD exists.'
END
case when "Customer DC" = "origin_dc" or "order_reason_type" = 'Off Schedule' or "mot_type" = 'UPS' then
'Yes'
else
'No'
end
CASE WHEN "module_type" is NULL THEN '---' ELSE "module_type" END
CASE WHEN "NODE_TYPE" = 'External' THEN '3rd Party' ELSE "ENTITY_LOCATION_DESCRIPTION" END
concat("Class",' > ',"Product Family",' > ',"Meta Series")