I have a flat file source that i am trying to parse some SAN data from. I have one column that has size info that is reported as "1.81 GB" or "500 MB". I am trying to created derived columns to have a number with a standard unit (MB).
I am having trouble with even the most basic conditional statments in the derived column expression. For example
As soon as i put any type of ? in it will fail. Ultimately i am try to something similar to the last example here. Read the units (MB,GB, or TB) from the tmp_total_space_units, and if it is GB, take the value from the converted_tmp_total_space (converted from unicode string to numeric in the data flow) multiply the value by 1000 (or 1000000 for TB).
I am always getting this error output
TITLE: Microsoft Visual Studio
------------------------------
Error at Data Flow Task [Derived Column 1 [73]]: Attempt to parse the expression "[tmp_total_space_units]=="GB" ? "test"" failed. The expression might contain an invalid token, an incomplete token, or an invalid element. It might
not be well-formed, or might be missing part of a required element such as a parenthesis.
Error at Data Flow Task [Derived Column 1 [73]]: Cannot parse the expression "[tmp_total_space_units]=="GB" ? "test"". The expression was not valid, or there is an out-of-memory error.
Error at Data Flow Task [Derived Column 1 [73]]: The expression "[tmp_total_space_units]=="GB" ? "test"" on "Derived Column 1.Outputs[Derived Column Output].Columns[Derived Column 2]" is not valid.
Error at Data Flow Task [Derived Column 1 [73]]: Failed to set property "Expression" on "Derived Column 1.Outputs[Derived Column Output].Columns[Derived Column 2]".
------------------------------
ADDITIONAL INFORMATION:
Exception from HRESULT: 0xC0204006 (Microsoft.SqlServer.DTSPipelineWrap)
------------------------------
BUTTONS:
OK
------------------------------
I have tried multiple columns with basic if/then type tests. I can do the first/last parts of the statement separately and they parse fine, but when i add the ?, it will error.