Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
May be try this
=Count({$<[Retained]={'Yes'}>}[Student ID])/Count(TOTAL <$(='[' & GetFieldSelections(Fields, '], [') & ']')> [Student ID])
May be try this
=Count({$<[Retained]={'Yes'}>}[Student ID])/Count(TOTAL <$(='[' & GetFieldSelections(Fields) & ']')> [Student ID])
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,
May be try this
=Count({$<[Retained]={'Yes'}>}[Student ID])/Count(TOTAL <$(='[' & GetFieldSelections(Fields, '], [') & ']')> [Student ID])
Brilliant thanks!
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
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])
Its been a long day...thanks Sunny, much appreciated!