Jump to content
  • 0

Change the calculation based on the using a checkbox


JustTrying
 Share

Question

Hello,

I appreciate any help on this.

I have a calculation that I want to perform normally but when a field with a check box is selected I want to round the number up. This is what I have come up with this, but it's not working. Am I working in the right direction?

CASE

WHEN [@cbParamVirtual2]!== "Y"

THEN Round(((([@field:width]*[@field:height])/144)*[@field:panes]),2))

ELSE (([@field:width]*[@field:height])/144)*[@field:panes]

END

 

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Hello, 

Can you try using this formula instead:

CASE

WHEN CAST('[@cbParamVirtual1]' AS BIT) != 1

THEN Round(((([@field:width]*[@field:height])/144)*[@field:panes]),2))

ELSE (([@field:width]*[@field:height])/144)*[@field:panes]

END

 

Try to convert your Virtual field as Bit. Also, make sure that the value is 1 in your virtual field:

image.png.3705e748c9a26391223b2a707822e892.png

Link to comment
Share on other sites

  • 0

Hello, 

Just to add in the previous response, the value of a Yes/No field is either 1 or 0. If you are going to use it in a Calculated value or calculated field, convert it first as Bit

CAST([@field:FIELDNAME] AS BIT)

Then, if you are using a virtual field as a checkbox, make sure that the value is 1 or 0 when checked.

 

Hope this helps!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...