Periscope Data Documentation

Connecting to Periscope

First Time Connecting

Connection Definitions

Common Connection Errors

Private Network SSH Tunnels

Integrations

Overview

Getting Started

Keyboard Shortcuts

Charts & Dashboards

Chart Overview

Chart Options

Dashboard Overview

Refresh Mechanics

Organizing Charts

Organizing Dashboards

Table-like Charts

Table Overview

Cohort Grids

Pivot Tables

Graph-like Charts

Overview & General Settings

Chart Types and Settings

Mixing Chart Types

Map Charts

Map Chart Overview

Heatmaps

Clusters and Bubbles

Satellite Maps

GeoJSON

Other Charts & Customizations

Pie Charts

Image Charts

Chart Annotations

Site Administration

Adding Users

Removing Users

User Types

User Groups

Two-Factor Authentication

Managing User Permissions

Dashboard Permissions

Site Preferences

Query Management

Color Themes

Dashboard Refresh Management

Usage Data

Periscope Cache

Caching Strategies

Querying the Periscope Cache

Cross-Database Joins

CSV Upload

Materializing Views

SQL Formatters

Using SQL Formatters

Composing SQL Formatters

Dollars and Percentages

Time Zone Formatters

Date Aggregation

Date Parts

Basic Filters

Custom Filters

Date Range Filters

Aggregation Filter

Adding, Moving, and Hiding Filters

Advanced Filters

Default Filters

Drilldowns

Parent-Child Filters

Matching Filter Values

Time Zone Conversions

Direct Replacement

User Friendly Names

Views

SQL Views

Joining to Views

More SQL Tools

SQL Snippets

Parameterized SQL Snippets

SQL Alerts

Automatic Joins

Sharing and Embedding

Sharing Dashboards Externally

Email Reports

Easy Embedding

Embed API

Embed API Options

Public CSV URL

Slack API

Slack Linking Reports

Data Management

Adding and Deleting Datasource

Spaces: Data-Level Permissions

Improving Query Throughput

Revoking Table Permissions

Salesforce Datasource

Schema Browser

SSO Integrations

Overview

Okta

OneLogin

Google Apps

Direct Replacement Filters

In addition to using filters in the traditional [created_at=daterange] fashion, filter values can be selected using [filter_name]. These types of direct replacement filters are a great way to substitute bits of sql directly into the query while allowing users to choose the value from the dashboard in the classic filter style.

Using Direct Replacement Filters

There are a couple different ways a filter can be integrated into the query. Here are a few common examples.

Dynamically Selecting Columns in the Query

To allow users to dynamically choose the columns they want selected in the query, first set up the filter with the available column options.

In the query, reference the filter using square parentheses like so:

Partial Phrase Replacement

Another common case is to use direct replacement filters to change part of a phrase.

This can be achieved by creating a ranged filter:

With the final implementation looking like:

Creating a null filter might look like:

The implementation and the generated sql would look like:

Default Values

Aside from setting a default filter value directly on the dashboard, a default value can be set in a direct replacement filter directly in the query.

This default value will be used when no filter option is selected within the dashboard. This is helpful for direct replacement filters, where the SQL query can produce an error when no filter option is selected.

Pipe Notation

When implementing direct replacement filters in the queries, the pipe symbol '|' can used to define a filter default. The filter default is substituted when no filter value is selected on the dashboard. To specify a default, after the filter name include the pipe followed by the default value:

[filter_name|default_value]

Using Default Values

First, create the filter to be used in the query.

Next, use the pipe in the query to define the default value. When nothing is selected in the filer, the pipe notation takes seniority:

However, when a filter option, such as Network, is selected in the dashboard, the filter option will be replaced into the query:

Filter Casing

Filter casing is case-sensitive for direct replacement filters. A filter within the SQL query with a lower-cased first letter will insert the original casing of the filter value. However, if the first letter is upper-cased, the inserted filter value will have an upper-cased first letter.

Direct Replacement Filters in Chart Titles

Direct replacement filters can be used in chart titles to help users identify the filters currently applied to the chart at the dashboard level. Here, filter casing is helpful to maintain properly cased titles.