on 10-10-2015 11:56 AM
Friends,
formula 1:
Sum( If( compute_6 = "Fail", 1, 0 ) For Group 1 ) === failed count
Formula 2:
count( compute_6 for group 1 ) ===== no. of rows
i am not able to use the below code. can anybody correct me the code?
if Sum( If( compute_6 = "Fail", 1, 0 ) For Group 1 ) >= 3 then "Ask your ward to see the class teacher"
else if
Sum( If( compute_6 = "Fail", 1, 0 ) For Group 1 ) <= 2 then "Ask your ward to concentrate more on the failed subjects"
else if
Sum( If( compute_6 = "Pass", 1, 0 ) For Group 1 ) = count( compute_6 for group 1 ) then "Well Done Keep it up"
end if
thanks..
You're trying to write PowerScript into a datawindow computed expression. That's not correct...
The IF THEN ELSE ENDIF syntax is PowerScript, used inside event and function scripts.
The datawindow expression uses the IF() function - and since you have multiple conditions/results, I'd recommend using the CASE() function.
CASE(
sum( if( compute_6 = 'Fail', 1, 0) for group 1)
when 0 then 'Well Done Keep it up'
when 1,2 then 'Ask your ward to concentrate more on the failed subjects'
when is >= 3 then 'Ask your ward to see the class teacher'
)
-Paul Horan-
IBM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
sorry for opening this thread again...
CASE(
sum( if( compute_6 = 'Fail', 1, 0) for group 1)
when 0 then 'Well Done Keep it up'
when 1,2 then 'Ask your ward to concentrate more on the failed subjects'
when is >= 3 then 'Ask your ward to see the class teacher'
)
now the situation is compute_6 is null but the code is executing the first condition that is...
when 0 then 'Well Done Keep it up'
if compute_6 is null i dont want to show anything..just a null space ...
where i have to make a change for getting a null value?
thanks
Hi Sathy;
Have you tried ...
Sum( If( Lower(compute_6) = "pass", 1, 0 )
Also, maybe a Trim() in there as well to remove blanks?
Regards ... Chris
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Create a new compute that returns 0 or 1, based on compute_6=Fail/Pass, or base the new compute on the code that creates Pass/Fail. Use the new compute in place of compute_6 for the Sum function calls.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.