In this article
Using CDL, apply suppression with recordsBase for reliability, respondentsBase for privacy, and custom for special cases.
recordsBase
Use recordsBase to suppress statistically not reliable results
suppression recordsBase
threshold: 25 //a number
}
respondentsBase
Use respondentsBase to suppress results of sensitive nature, will suppress ALL values within cell.
Will be defined within cell, TE will allow to inherit/override from parent level to current level
suppression respondentsBase
//base: count(survey:)
//would be better if
table: survey: //or baseTable: or respondentsTable:?
filter: expr //-> will end up with count(table, expr) as __base__
threshold: 25 // a number
in: sameCell | totalInRows | totalInColumns
suppressTotal: false | true //by default false
showAs: blank, lessThanTrheshold, "text"//if easy to add, blank by default
}
custom
Use custom to support exotic cases
suppression custom { //utilizing all TE possibilities
what: value, extraValue // by default is blank witch means suppress all values
in: sameCell | totalInRows | totalInColumns
// independent expression
when expression {
value: expression
}
// referencing existing value
when reference {
valueId: extraValue
operator: "<" | ">" | "<=" | ">=" //by default "<"
threshold: 10 //number, for reusable value can use @cr.threshold
}
//using formulas
when formula {
//TBC
}
suppressTotal: false | true //by default false
displayAs: blank | "some text" | ... //by default blank
}Widget Examples
Individual Question
In this example, suppression is performed on the total level. i.e. all categories are shown until the suppression threshold is more than the total (157), then the entire question is suppressed.
Before:
Q1 | Positive | 10 |
| Neutral | 56 | |
| Negative | 100 | |
| Total | 157 |
After:
Q1 | Positive | |
| Neutral | ||
| Negative | ||
| Total | 157 |
CDL
widget dataGrid{
suppression respondentsBase{
base: count(survey:)
threshold: 160
in: totalInRows
}
column {}
row cut {
value: survey:q1
cell {
value #v: count(survey:)
}
}
}Questions in Rows
In the example below, we wish to use the question base to compare against the suppression threshold. e.g. once the threshold is < 30 the entire row for Q2 would disappear. Individual cell values less than this threshold remain.
Before:
| Total | Jan | Feb | Mar | |
| Q1 | 30 | 10 | 5 | 15 |
| Q2 | 20 | 7 | 7 | 6 |
| Q3 | 30 | 11 | 10 | 9 |
After (Row Suppression < 25):
Use removeEmptyRows to hide Q2 row
| Total | Jan | Feb | Mar | |
| Q1 | 30 | 10 | 5 | 15 |
| Q2 | 20 | |||
| Q3 | 30 | 11 | 10 | 9 |
CDL Variant 1
widget dataGrid {
suppression respondentsBase{
base: count(survey:)
threshold: 30
in: totalInColumns
}
cell {
value: count(survey:)
}
column cutByDate{
value: survey:interview_start
breakdwonBy: calendarMonth
totalLabel: "Total"
}
row {
filter: _isNotNull(survey:q1)
label: "Q1"
}
row {
filter: _isNotNull(survey:q2)
label: "Q2"
}
row {
filter: _isNotNull(survey:q3)
label: "Q3"
}
}Base Values in Cells
When displaying a particular statistic with a different base value, we need to implement cell-level suppression. For instance, consider an example where each cell displays an average value with the base value indicated in parentheses. If a suppression threshold of 10 is set, only cells with a base of 10 or above would be visible.
For example, in a grid where multiple averages are shown (each with their respective base value in brackets), if the suppression threshold is 10, only cells with a base of 10 or more (such as F/MSC) will be visible.
Before:
| MSC | YAR | |
| M | 3.3. (1) | 7.6 (5) |
| F | 1.1 (20) | 5.7 (8) |
After (Cell supression <10):
| MSC | YAR | |
| M | ||
| F | 1.1 (20) |
CDL Example
widget dataGrid{
suppression recordsBase {
threshold: 10
}
filter expression {
value: survey:intervewStatus = "complete"
}
column cut {
value: survey:city
total: none
}
row cut {
value: survey:sex
total: none
}
cell {
value: avg(score(survey:q1))
extraValue: count(survey:)
}
}Suppression in Widget Chart
We can apply suppression to a widget chart similarly, focusing on series instead of individual values, with suppression being applied only to categories. Initially, we will aim to adapt the widget chart to utilize the dataGrid worker.
Chart CDL Example: If results are unreliable
widget chart {
suppression recordsBase { //do not show if results are unreliable
threshold: 10
}
series {
value: avg(survey:q1)
}
category date {
value: survey:interview_start
breakdownBy: calendarMonth
}
}
Chart CDL Example: If results are of a sensitive nature
widget chart {
suppression respondentsBase { //will clean up some categories
base: count( survey:)
threshold: 10
}
eries {
value: avg(survey:q1)
}
category cut {
value: survey:city
}
}