0

lets say i have a column with many lines but only two values, A and B:

i am trying unsuccessfully to count only lines with A - in a summary calculation for a dashboard (without making a new column for this specific calculation) the expression which gives me syntax error is this:

count([column] = 'A')

any suggestion?

avish
  • 37
  • 7

2 Answers2

0

You'll need to use an if then else construct:

count( if([Column]='A') then ([Column]) else (Null))

Daniel Wagemann
  • 741
  • 4
  • 6
  • great! worked perfectly, couldn't find it anywhere, do you know where can i find resources for this? – avish Aug 11 '20 at 08:22
0

You can use IF-THEN-ELSE or CASE-WHEN-THEN-ELSE to create your own count:

sum(
  if ([Query Item] = 'A')
  then (1)
  else (0)
)

or

sum(
  case
    when [Query Item] = 'A'
      then 1
    else 0
  end
)
dougp
  • 2,810
  • 1
  • 8
  • 31