Aditya Singh 3 Posted December 9, 2020 Share Posted December 9, 2020 Hi, I have acalculated column where one column will be loaded for few dates but not always. So my calculation is like- Calculated Col= [Column1 + [Column2]. When both the columns are availavle, the calculation works fine but when one of the column is missing, then calculation gives error. Is there any way to replace column with 0 if it's not available like we do for SN function. Link to comment Share on other sites More sharing options...
Paul Shumaker Posted December 9, 2020 Share Posted December 9, 2020 If([Column1] IS NULL, 0, [Column1] ) + If([Column2] IS NULL, 0, [Column2]) Link to comment Share on other sites More sharing options...
Aditya Singh 3 Posted December 9, 2020 Author Share Posted December 9, 2020 Thanks but this expression is aplicable to null values of column not when Column itself it not available(not loaded in datatable). Link to comment Share on other sites More sharing options...
Fabian Duerr Posted December 9, 2020 Share Posted December 9, 2020 I don't think that this is possible... But as I workaround I would try to ensure that your source data is consistent. So maybe you could check during data load if this column is available and if not you create it filled with 0. Or fix the issue right in your source data. Link to comment Share on other sites More sharing options...
Gaia Paolini Posted December 10, 2020 Share Posted December 10, 2020 I tried to solve a similar problem (inconsistent columns) with Iron Python here: https://community.spotfire.com/questions/adding-blank-column-using-ironpython maybe useful Link to comment Share on other sites More sharing options...
Aditya Singh 3 Posted February 1, 2021 Author Share Posted February 1, 2021 Thanks, but the source which I am using does not allow to write custom queries. I have to aload whatever is available. There are few columns which are available for some periods like only in 2012 but not in other years. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now