Announcements
cancel
Showing results for
Did you mean:
Creator II

## User defined field within expression

Hoping someone can help. I have an expression for calculating percentages within a table where users can define the visible fields:

=count({\$<[Retained]={'Yes'}>}[Student ID])/count(TOTAL <GetFieldSelections(Fields)> [Student ID])

The getfieldselections statement is meant to allow users to specify what the context of the calculated percentage e.g. by programme, gender, session etc. However when I try this, the calculation is blank.

Does anyone know where I might be going wrong?

Appreciated.

Matt

1 Solution

Accepted Solutions
MVP

May be try this

=Count({\$<[Retained]={'Yes'}>}[Student ID])/Count(TOTAL <\$(='[' & GetFieldSelections(Fields, '], [') & ']')> [Student ID])

7 Replies
MVP

May be try this

=Count({\$<[Retained]={'Yes'}>}[Student ID])/Count(TOTAL <\$(='[' & GetFieldSelections(Fields) & ']')> [Student ID])

Creator II
Author

Thanks Sunny that does work! One question though, is there a way for it to accept multiple selections? E.g. selecting session and gender to display a percentage which adds up to 100% for each session.

Thanks,

MVP

May be try this

=Count({\$<[Retained]={'Yes'}>}[Student ID])/Count(TOTAL <\$(='[' & GetFieldSelections(Fields, '], [') & ']')> [Student ID])

Creator II
Author

Brilliant thanks!

Creator II
Author

Hi Sunny,

Hoping you might be able to help with a quick question, I'm trying to add in an additional set analysis criteria (specifying a particular session) to the above expression but it's throwing up errors. Any ideas why?

=count({\$<[Retained]={'Yes'},[Session]={'2015/16'}>}[Student ID])/count(TOTAL <{\$(='[' & GetFieldSelections(Fields, '], [') & ']'),[Session]={'2015/16'}>}[Student ID])

Many thanks,

Matt

MVP

Because what I added was not set analysis, it was field name used by TOTAL qualifier... try this

=Count({\$<[Retained]={'Yes'}, [Session]={'2015/16'}>} [Student ID])/Count({<[Session]={'2015/16'}>} TOTAL <\$(='[' & GetFieldSelections(Fields, '], [') & ']')> [Student ID])

Creator II
Author

Its been a long day...thanks Sunny, much appreciated!

Community Browser