Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a straight table, which I would only like to show students that have a risk % greater than the value set in the slider object.
I have tried to achieve this by setting this on the Presentation tab, under the conditional show/hide expression, BUT it isn't really working.
Any ideas?
Thanks
You should look into eliminating the syntethic key in your data model, since this is likely to cause problems in the long run with your calculations.
Please notice that you have altered the Conditional show for the fields and not for the rows. This means that when the condition you have set up is equal to True, then the field will be show else it will be hidden.
The quick fix is to set the conditional show to always show, so that you don't accidentally hide a column in your table. Then you can add a IF statement in your expression, meaning that if your calculation is below the vRiskRnage variable then the calculation shoudl be executed. Note that when the value is above the variable the IF will set the field value to Null, which will not be presented since you have Suppress Zero Values enabled for the table object.
Keep in mind that this type of double calculation can get heavy if you app has a lot of data and the caluculation is complex. Therefore it is recommended to do as much calculation as possible in the load script to minimize the impact runtime performance.
=if( (
(SUM(AttendanceFlag)/count( {$<System = {'Lecturers'}>} [Activity Date] ) * 0.30 +
(SUM(AssignmentFlag)/
count( {$<System = {'Assignments'}>} [Activity Date] ) ) * 0.40 +
count( {$<LoginFlag = {0}>} [Activity Date] )/
count( {$<System = {'Network login'}>} [Activity Date] ) * 0.30)
) < $(vRiskRange),
(SUM(AttendanceFlag)/count( {$<System = {'Lecturers'}>} [Activity Date] ) * 0.30 +
(SUM(AssignmentFlag)/
count( {$<System = {'Assignments'}>} [Activity Date] ) ) * 0.40 +
count( {$<LoginFlag = {0}>} [Activity Date] )/
count( {$<System = {'Network login'}>} [Activity Date] ) * 0.30)
)
You should look into eliminating the syntethic key in your data model, since this is likely to cause problems in the long run with your calculations.
Please notice that you have altered the Conditional show for the fields and not for the rows. This means that when the condition you have set up is equal to True, then the field will be show else it will be hidden.
The quick fix is to set the conditional show to always show, so that you don't accidentally hide a column in your table. Then you can add a IF statement in your expression, meaning that if your calculation is below the vRiskRnage variable then the calculation shoudl be executed. Note that when the value is above the variable the IF will set the field value to Null, which will not be presented since you have Suppress Zero Values enabled for the table object.
Keep in mind that this type of double calculation can get heavy if you app has a lot of data and the caluculation is complex. Therefore it is recommended to do as much calculation as possible in the load script to minimize the impact runtime performance.
=if( (
(SUM(AttendanceFlag)/count( {$<System = {'Lecturers'}>} [Activity Date] ) * 0.30 +
(SUM(AssignmentFlag)/
count( {$<System = {'Assignments'}>} [Activity Date] ) ) * 0.40 +
count( {$<LoginFlag = {0}>} [Activity Date] )/
count( {$<System = {'Network login'}>} [Activity Date] ) * 0.30)
) < $(vRiskRange),
(SUM(AttendanceFlag)/count( {$<System = {'Lecturers'}>} [Activity Date] ) * 0.30 +
(SUM(AssignmentFlag)/
count( {$<System = {'Assignments'}>} [Activity Date] ) ) * 0.40 +
count( {$<LoginFlag = {0}>} [Activity Date] )/
count( {$<System = {'Network login'}>} [Activity Date] ) * 0.30)
)