Fusion Manage Forum
Welcome to Autodesk’s Fusion Manage (formerly Fusion 360 Manage) Forum. Share your knowledge, ask questions, and explore popular Fusion Manage topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

COMPUTED FIELD (CASE STATEMENT)

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
kjiel
776 Views, 2 Replies

COMPUTED FIELD (CASE STATEMENT)

We buy goods in both Liters and Gallons, but want to have a field that shows the computed gallonage.

 

I've been trying this: 

CASE
WHEN (PURCHASE_TYPE = 'Liters')
THEN PURCHASE_VOLUME * 3.7854
ELSE
        PURCHASE_VOLUME
END

 

It continues to give me a server error. When I don't use case it works fine. 

 

How should I be doing If / else statemetns for a computed field?

2 REPLIES 2
Message 2 of 3
jpiggee
in reply to: kjiel

Kjiel,


Using a basic test of 4 fields:Auto number (used to track item in workspace)PURCHASE_TYPE (used as your switch for 'liters')
PURCHASE_VOLUME (used as base count)Adjusted (output for adjusted field)
I was unable to find an issue with you case statment outside of the lack of spaces in some areas.
please try again with the modified case statement and the test above.


CASE WHEN(PURCHASE_TYPE = 'Liters')THEN PURCHASE_VOLUME * 3.7854 ELSEPURCHASE_VOLUME END

 

case working.PNG

Joseph Piggee
Fusion 360 Administrator
TPI Composites
jpiggee@tpicomposites.com
Message 3 of 3
jpiggee
in reply to: jpiggee

Kjiel,

 

Also please remember if you are using this with a combination with a picklist, pick list are defined by order position such as

 

0 = pints

1= liters

2 = gallons

 

The location of the item in question is constant, but the position of the item needs to be located in order to find what you want to compare against.

 

The location of the item in question can be found by creating a computed field equal to the pick list field in question. Once you have this information then you can run a comparison.

 

For example:

 

 if liters is equal to 0

 

Then you case script would be:

 

CASE WHEN
(PURCHASE_TYPE = '0')THEN PURCHASE_VOLUME * 3.7854 ELSE
PURCHASE_VOLUME END

 

If liters is equal to 1

 

Then your case script would be:

 

CASE WHEN
(PURCHASE_TYPE = '1')THEN PURCHASE_VOLUME * 3.7854 ELSE
PURCHASE_VOLUME END

Joseph Piggee
Fusion 360 Administrator
TPI Composites
jpiggee@tpicomposites.com

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report