14 Replies Latest reply on Aug 23, 2018 10:00 AM by Jessica Singer

# Simple calc returns NOTHING, why?

I need to build a composite score for each student, in each period, so that I can compare the change over time. However, to ensure fidelity I have to exclude those scores for skills that were not tested in each period.

I've tried:

IF ISNULL([Score Pre]) OR ISNULL([Score Post]) THEN NULL

ELSE [Score Pre]

END

Which is a variation of a calc I was given in a previous thread. But this returns nothing. I've tried wrapping it in SUM, also nothing.

Help! And thank you.

• ###### 1. Re: Simple calc returns NOTHING, why?

Hi Jessica

I looked at your data and for each record either pre score or post score will be Null

so the first clause in you conditional statement will always be True and you never get to the else clause

Jim

If this posts assists in resolving the question, please mark it helpful or as the 'correct answer' if it resolves the question. This will help other users find the same answer/resolution.  Thank you.

• ###### 2. Re: Simple calc returns NOTHING, why?

This looks like an issue with your data. Every record that does have a Score Pre has a NULL Score Post and vice versa:

• ###### 3. Re: Simple calc returns NOTHING, why?

Now that I look at your data model, I think I understand. It looks like you are doing a UNION to bring together or Pre and Post scores, so each is on a separate record, correct? If that's true, then try this:

IF ISNULL(SUM([Score Pre])) OR ISNULL(SUM([Score Post])) THEN

NULL

ELSE

SUM([Score Pre])

END

It will sum up each of the scores (for the level of detail of your view).

• ###### 4. Re: Simple calc returns NOTHING, why?

You Need to Do it This Way:

IF ISNULL(SUM([Score Post]))OR ISNULL(SUM([Score Pre])) THEN NULL

ELSE SUM([Score Pre])

END

Thanks

Deepak

If it Helps, Pl mark it Helpful and CORRECT to CLOSE Thread

• ###### 5. Re: Simple calc returns NOTHING, why?

Hi Jessica,

Change your calculation like below you will get the required O/P

If you don't want to use the student and skill in view but need to use in your calculation

IF ISNULL({Fixed StudentName,Skil:SUM(Score Pre)}) or

ISNULL({Fixed StudentName,Skil:SUM(Score Post)})

then

NULL

else

({Fixed StudentName,Skil:SUM(Score Post)})

END

hope this helps kindly mark this answer as correct/helpful so that it will help others

BR,

NB

• ###### 6. Re: Simple calc returns NOTHING, why?

Hi Jessica,

This is because in your calculation, you were taking the individual values, and not the aggregated value on Student name.

Anyhow you can modify the logic as below:

IF ISNULL(sum([Score Pre])) OR ISNULL(sum([Score Post])) THEN NULL ELSE sum([Score Pre])  END

• ###### 7. Re: Simple calc returns NOTHING, why?

This works a treat in the view as is. But it doesn't aggregate up correctly? I'm still getting a Pre total for Aaron Wong of 95, when it should sum to 69?

• ###### 9. Re: Simple calc returns NOTHING, why?

HI Jessica,

For that you just have to do below steps:

• ###### 10. Re: Simple calc returns NOTHING, why?

Thank you thank you thank you!

• ###### 11. Re: Simple calc returns NOTHING, why?

But, how do I do this when I pull Skill out of the viz?

I need one round number for each period, rather than skill by skill (that's for a different sheet).

• ###### 12. Re: Simple calc returns NOTHING, why?

Jessica,

Use calc like below

If you don't want to use the student and skill in view but need to use in your calculation

IF ISNULL({Fixed StudentName,Skil:SUM(Score Pre)}) or

ISNULL({Fixed StudentName,Skil:SUM(Score Post)})

then

NULL

else

({Fixed StudentName,Skil:SUM(Score Post)})

END

Hope this helps kindly mark this answer as correct or helpful so that it will help Others

BR,

NB

• ###### 13. Re: Simple calc returns NOTHING, why?

Hi Jessica,

In That Case , you may Use an LOD

Like This:

When Skill is Out

Thanks

Deepak

• ###### 14. Re: Simple calc returns NOTHING, why?

Seriously, thank you. If only real life was filled with people as helpful as on these boards!