Skip to content

Change data types by C# script #1163

Discussion options

You must be logged in to vote
  1. This change is not guaranteed to reduce the model size. That depends on the cardinality (i.e. number of unique values) within the column. If you have a lot of values that differ only by very small decimal digits (i.e. less than the first 4 decimals), then this change can reduce the size of the column in memory, at the cost of less precision. In general, floating point values (double) is not recommended unless you have a specific need for it. More info here.
  2. Use foreach(var c in Model.AllColumns). However, you should probably add a check to make sure you're only changing columns that are currently set to Double:
// Loop through all columns of the model:
foreach (var c in Model.AllColumns)
{

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@rvgfox
Comment options

Answer selected by otykier
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
content: script assistance Help on C# scripting
2 participants