• 0

# Get the Sum of Yes Response in Tabular Report DataPage

## Question

Can someone help me get the sum of the yes responses in my data? I'm using a tabular reports Datapage.

## Recommended Posts

• 0

@CaptNemo

You can do the following to have an aggregation for yes no field.

1) Insert a Calculated Field and use the following code. Repeat these steps for Tuesday, Wednesday, and Thursday:

CASE WHEN [@field:YourYesNofield]=1 THEN 1 ELSE 0 END

2) Insert a Total & Aggregated Field and apply the Sum Function. Then, include the calculated fields you created in the Selected Fields section.

Hope this helps!

##### Share on other sites

• 0

I've tried that one but its not allowing to be place on 1 aggregate. Can you help me on this one?

##### Share on other sites

• 0

@CaptNemo

If you are trying to display it in one row you can refer to this post

Sample Code:

```HEADER

<style>
tr[data-cb-aggregation="Aggregate2"],
tr[data-cb-aggregation="Aggregate3"],
tr[data-cb-aggregation="Aggregate4"] {
display: none;
}
td.cbResultSetTotalsData{
font-weight: bold !important;
}
</style>

FOOTER
<script>
function moveTotalsToOneRow() {
const totalsSecond = document.querySelector('tr[data-cb-aggregation="Aggregate2"] td:nth-child(2)').innerHTML;
const totalsThird= document.querySelector('tr[data-cb-aggregation="Aggregate3"] td:nth-child(2)').innerHTML;
const totalsForth= document.querySelector('tr[data-cb-aggregation="Aggregate4"] td:nth-child(2)').innerHTML;
document.querySelector('tr[data-cb-aggregation="Aggregate1"] td:nth-child(3)').innerHTML = totalsSecond;
document.querySelector('tr[data-cb-aggregation="Aggregate1"] td:nth-child(4)').innerHTML = totalsThird;
document.querySelector('tr[data-cb-aggregation="Aggregate1"] td:nth-child(5)').innerHTML = totalsForth;
}
</script>```

## Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.