Announcements
MAINTENANCE ALERT: Dec. 12th starting 9 AM CET. Community will be read-only. GET DETAILS
cancel
Showing results for
Did you mean:
Creator II

## Why calculated fields shows minus (-) and not a value?

Hi QV users,

i have a problem with calculated fields.

I've imported some txt files and i create a table with some fields and calculated ones.

I don't know why the column "LABEL4" ([LABEL1]-[LABEL2]-[LABEL3]) don't show me any value but only a minus (-).

If  correct, the total of "LABEL4" should be the same of the total of "LABEL1".

I think that the problem is in the expression "LABEL2":

Num(If([FIELD4]=1,
Num(Left([FIELD2],5)
& ',' &
Num(Right([FIELD2],2)
,0))))

and "LABEL3":

Num(If([FIELD4]=1,
Num(Left([FIELD3],2)
& ',' &
Num(Right([FIELD3],2)
,0))))

Thanks,

Mattia

Labels (4)

• ### txt file

1 Solution

Accepted Solutions
Partner - Specialist

Hello Mattia,

I believe your if statements have to be reworked a bit.  Without sample data is hard to say but it seems they are returning nulls therefore the operation [LABEL1] - [LABEL2] - [LABEL3] result is null which is represented by a -

My suggestion is to evaluate each LABEL on it's own before calculating LABEL4.

Try this for LABEL2 (and same idea of the LABEL3). I just moved the closing parenthesis....

num(If([FIELD4]=1
,num(Left([FIELD2],5)& ',' &Num(Right([FIELD2],2)))
,0
)
)

4 Replies
Partner - Specialist

Hello Mattia,

I believe your if statements have to be reworked a bit.  Without sample data is hard to say but it seems they are returning nulls therefore the operation [LABEL1] - [LABEL2] - [LABEL3] result is null which is represented by a -

My suggestion is to evaluate each LABEL on it's own before calculating LABEL4.

Try this for LABEL2 (and same idea of the LABEL3). I just moved the closing parenthesis....

num(If([FIELD4]=1
,num(Left([FIELD2],5)& ',' &Num(Right([FIELD2],2)))
,0
)
)

Creator II

I believe that means that there is more than one possible value for that expression. If you use a listbox and select only one value for Field 2 or Field 3, it should show some value. You may need to use set analysis or other logic to get it to display what you want.

Creator II
Author

Thanks guys for the message.

I'll try and i'll let you know!

Mattia

Creator II
Author

Thank you so much, Alberto!

Now, it works!!!

Have a nice day,

Mattia

Community Browser