Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
176 commits
Select commit Hold shift + click to select a range
15214bf
New translations script-create-and-replace-m-parameter.md (Spanish)
DBojsen Mar 30, 2026
09c3ab1
New translations script-implement-incremental-refresh.md (Spanish)
DBojsen Mar 30, 2026
4b89adb
New translations csharp-script-library.md (Spanish)
DBojsen Mar 30, 2026
1433db5
New translations command-line-options.md (Spanish)
DBojsen Mar 30, 2026
8895acc
New translations useful-script-snippets.md (Spanish)
DBojsen Mar 30, 2026
73c5baa
New translations code-actions.md (Spanish)
DBojsen Mar 30, 2026
06642a5
New translations dax-editor.md (Spanish)
DBojsen Mar 30, 2026
3b7e34d
New translations perspective-editor.md (Spanish)
DBojsen Mar 30, 2026
250b1e4
New translations using-bpa.md (Spanish)
DBojsen Mar 30, 2026
ca070b9
New translations tom-explorer-view.md (Spanish)
DBojsen Mar 30, 2026
75d6c05
New translations getting-started-te2.md (Spanish)
DBojsen Mar 30, 2026
4708a9c
New translations importing-tables-data-modeling.md (Spanish)
DBojsen Mar 30, 2026
b57965c
New translations index.md (Spanish)
DBojsen Mar 30, 2026
da2b6a5
New translations migrate-from-te2.md (Spanish)
DBojsen Mar 30, 2026
02a681f
New translations undo-redo.md (Spanish)
DBojsen Mar 30, 2026
25d515f
New translations preferences.md (Spanish)
DBojsen Mar 30, 2026
654c46f
New translations security-privacy.md (Spanish)
DBojsen Mar 30, 2026
d98fdae
New translations incremental-refresh-about.md (Spanish)
DBojsen Mar 30, 2026
8cadaf5
New translations semantic-bridge.md (Spanish)
DBojsen Mar 30, 2026
403a258
New translations best-practice-analyzer.md (Chinese Simplified)
DBojsen Mar 30, 2026
8733752
New translations csharp-script-library-advanced.md (Chinese Simplified)
DBojsen Mar 30, 2026
e37b93b
New translations useful-script-snippets.md (Chinese Simplified)
DBojsen Mar 30, 2026
cf4cc65
New translations workspace-database.md (Chinese Simplified)
DBojsen Mar 30, 2026
25bc281
New translations code-actions.md (Chinese Simplified)
DBojsen Mar 30, 2026
f5cf1aa
New translations csharp-scripts.md (Chinese Simplified)
DBojsen Mar 30, 2026
4c78615
New translations dax-debugger.md (Chinese Simplified)
DBojsen Mar 30, 2026
d663be5
New translations dax-editor.md (Chinese Simplified)
DBojsen Mar 30, 2026
f60bb90
New translations dax-query.md (Chinese Simplified)
DBojsen Mar 30, 2026
2498e06
New translations import-tables.partial.md (Chinese Simplified)
DBojsen Mar 30, 2026
00500ea
New translations script-helper-methods.md (Chinese Simplified)
DBojsen Mar 30, 2026
724fd42
New translations using-bpa-sample-rules-expressions.md (Chinese Simpl…
DBojsen Mar 30, 2026
05c3a14
New translations diagram-view.md (Chinese Simplified)
DBojsen Mar 30, 2026
d773f73
New translations find-replace.md (Chinese Simplified)
DBojsen Mar 30, 2026
47f0730
New translations tom-explorer-view.md (Chinese Simplified)
DBojsen Mar 30, 2026
6cacc87
New translations user-interface.md (Chinese Simplified)
DBojsen Mar 30, 2026
ec4af62
New translations desktop-limitations.md (Chinese Simplified)
DBojsen Mar 30, 2026
e43cab9
New translations getting-started.md (Chinese Simplified)
DBojsen Mar 30, 2026
b3136e5
New translations importing-tables-data-modeling.md (Chinese Simplified)
DBojsen Mar 30, 2026
d803d3f
New translations index.md (Chinese Simplified)
DBojsen Mar 30, 2026
5ddef68
New translations installation.md (Chinese Simplified)
DBojsen Mar 30, 2026
3b6bf73
New translations migrate-from-te2.md (Chinese Simplified)
DBojsen Mar 30, 2026
6e3319d
New translations parallel-development.md (Chinese Simplified)
DBojsen Mar 30, 2026
6b7becc
New translations personalizing-te3.md (Chinese Simplified)
DBojsen Mar 30, 2026
09632ce
New translations refresh-preview-query.md (Chinese Simplified)
DBojsen Mar 30, 2026
1c4be1b
New translations advanced-scripting.md (Chinese Simplified)
DBojsen Mar 30, 2026
9b1b5e1
New translations importing-tables.md (Chinese Simplified)
DBojsen Mar 30, 2026
17c2ba7
New translations xmla-as-connectivity.md (Chinese Simplified)
DBojsen Mar 30, 2026
7c61ec9
New translations downloads.md (Chinese Simplified)
DBojsen Mar 30, 2026
ae9812e
New translations policies.md (Chinese Simplified)
DBojsen Mar 30, 2026
f6b8d70
New translations preferences.md (Chinese Simplified)
DBojsen Mar 30, 2026
e7f5e66
New translations supported-files.md (Chinese Simplified)
DBojsen Mar 30, 2026
723b013
New translations security-privacy.md (Chinese Simplified)
DBojsen Mar 30, 2026
5c6140e
New translations maintaining-calculations-using-scripting.md (Chinese…
DBojsen Mar 30, 2026
a1349bd
New translations calendars.md (Chinese Simplified)
DBojsen Mar 30, 2026
a364961
New translations direct-lake-guidance.md (Chinese Simplified)
DBojsen Mar 30, 2026
47f60c9
New translations incremental-refresh-about.md (Chinese Simplified)
DBojsen Mar 30, 2026
1fcdda5
New translations udfs.md (Chinese Simplified)
DBojsen Mar 30, 2026
7dc81cb
New translations built-in-bpa-rules.md (Chinese Simplified)
DBojsen Mar 30, 2026
889fd63
New translations save-with-supporting-files.md (Chinese Simplified)
DBojsen Mar 30, 2026
7a990c2
New translations semantic-bridge-metric-view-object-model.md (Chinese…
DBojsen Mar 30, 2026
2a76754
New translations semantic-bridge.md (Chinese Simplified)
DBojsen Mar 30, 2026
422288a
New translations index.md (Chinese Simplified)
DBojsen Mar 30, 2026
dbe8046
New translations composite-model-measure-formatting.md (Chinese Simpl…
DBojsen Mar 30, 2026
d6f53ae
New translations databricks-column-comments-length.md (Chinese Simpli…
DBojsen Mar 30, 2026
5e473fe
New translations ai-assistant.md (Chinese Simplified)
DBojsen Mar 30, 2026
7943c4e
New translations bpa-udf-use-compound-names.md (Chinese Simplified)
DBojsen Mar 30, 2026
d23e97a
New translations 3_26_0.md (Chinese Simplified)
DBojsen Mar 30, 2026
7353b99
New translations tmdl.md (Chinese Simplified)
DBojsen Mar 30, 2026
ae76cb2
New translations shortcuts3.md (Chinese Simplified)
DBojsen Mar 30, 2026
ccdb6d5
New translations script-convert-dlol-to-import.md (Chinese Simplified)
DBojsen Mar 30, 2026
a91f3b7
New translations tom-explorer-view.md (Spanish)
DBojsen Mar 30, 2026
b514797
New translations perspective-editor.md (Spanish)
DBojsen Mar 30, 2026
1cbe38b
New translations index.md (Chinese Simplified)
DBojsen Mar 30, 2026
a7cc706
New translations best-practice-analyzer.md (Chinese Simplified)
DBojsen Mar 30, 2026
6588763
New translations script-add-databricks-metadata-descriptions.md (Chin…
DBojsen Mar 30, 2026
ac8754e
New translations script-convert-dlsql-to-dlol.md (Chinese Simplified)
DBojsen Mar 30, 2026
fed6169
New translations csharp-script-library-advanced.md (Chinese Simplified)
DBojsen Mar 30, 2026
36168c2
New translations useful-script-snippets.md (Chinese Simplified)
DBojsen Mar 30, 2026
4d1c26a
New translations workspace-database.md (Chinese Simplified)
DBojsen Mar 30, 2026
b39c487
New translations script-convert-dlol-to-import.md (Chinese Simplified)
DBojsen Mar 30, 2026
983059f
New translations script-create-and-replace-m-parameter.md (Spanish)
DBojsen Mar 30, 2026
5f05562
New translations script-implement-incremental-refresh.md (Spanish)
DBojsen Mar 30, 2026
b27f17a
New translations csharp-script-library.md (Spanish)
DBojsen Mar 30, 2026
853bf25
New translations command-line-options.md (Spanish)
DBojsen Mar 30, 2026
56f27c5
New translations useful-script-snippets.md (Spanish)
DBojsen Mar 30, 2026
6b01238
New translations code-actions.md (Spanish)
DBojsen Mar 30, 2026
e058523
New translations tom-explorer-view.md (Spanish)
DBojsen Mar 30, 2026
ee42ad8
New translations getting-started-te2.md (Spanish)
DBojsen Mar 30, 2026
cc4570f
New translations index.md (Spanish)
DBojsen Mar 30, 2026
2498c40
New translations migrate-from-te2.md (Spanish)
DBojsen Mar 30, 2026
902a70b
New translations semantic-bridge.md (Spanish)
DBojsen Mar 30, 2026
b8238e0
New translations command-line-options.md (Chinese Simplified)
DBojsen Mar 30, 2026
9b3a573
New translations code-actions.md (Chinese Simplified)
DBojsen Mar 30, 2026
151e677
New translations code-actions.md (Chinese Simplified)
DBojsen Mar 30, 2026
32d76dd
New translations creating-macros.md (Chinese Simplified)
DBojsen Mar 30, 2026
a18aca1
New translations csharp-scripts.md (Chinese Simplified)
DBojsen Mar 30, 2026
1f2ab79
New translations dax-debugger.md (Chinese Simplified)
DBojsen Mar 30, 2026
fec3817
New translations dax-editor.md (Chinese Simplified)
DBojsen Mar 30, 2026
052bcff
New translations dax-query.md (Chinese Simplified)
DBojsen Mar 30, 2026
652af12
New translations deployment.md (Chinese Simplified)
DBojsen Mar 30, 2026
37da317
New translations import-tables.partial.md (Chinese Simplified)
DBojsen Mar 30, 2026
e8d9cb7
New translations metadata-translation-editor.md (Chinese Simplified)
DBojsen Mar 30, 2026
4673338
New translations perspective-editor.md (Chinese Simplified)
DBojsen Mar 30, 2026
97788bb
New translations script-helper-methods.md (Chinese Simplified)
DBojsen Mar 30, 2026
af4dd23
New translations using-bpa-sample-rules-expressions.md (Chinese Simpl…
DBojsen Mar 30, 2026
f00af64
New translations diagram-view.md (Chinese Simplified)
DBojsen Mar 30, 2026
25344bf
New translations find-replace.md (Chinese Simplified)
DBojsen Mar 30, 2026
6250128
New translations tom-explorer-view.md (Chinese Simplified)
DBojsen Mar 30, 2026
1b54938
New translations user-interface.md (Chinese Simplified)
DBojsen Mar 30, 2026
06604eb
New translations user-interface.md (Chinese Simplified)
DBojsen Mar 31, 2026
6541db9
New translations desktop-limitations.md (Chinese Simplified)
DBojsen Mar 31, 2026
5143e66
New translations editions.md (Chinese Simplified)
DBojsen Mar 31, 2026
e18d0fd
New translations getting-started.md (Chinese Simplified)
DBojsen Mar 31, 2026
7dd1ed8
New translations importing-tables-data-modeling.md (Chinese Simplified)
DBojsen Mar 31, 2026
eb84c9b
New translations index.md (Chinese Simplified)
DBojsen Mar 31, 2026
0ed30eb
New translations installation.md (Chinese Simplified)
DBojsen Mar 31, 2026
5e9a944
New translations migrate-from-te2.md (Chinese Simplified)
DBojsen Mar 31, 2026
38ee3b9
New translations parallel-development.md (Chinese Simplified)
DBojsen Mar 31, 2026
1890af4
New translations personalizing-te3.md (Chinese Simplified)
DBojsen Mar 31, 2026
bc187dc
New translations refresh-preview-query.md (Chinese Simplified)
DBojsen Mar 31, 2026
1bb6572
New translations advanced-scripting.md (Chinese Simplified)
DBojsen Mar 31, 2026
f8dc24a
New translations importing-tables.md (Chinese Simplified)
DBojsen Mar 31, 2026
c276863
New translations xmla-as-connectivity.md (Chinese Simplified)
DBojsen Mar 31, 2026
a4c82c9
New translations downloads.md (Chinese Simplified)
DBojsen Mar 31, 2026
421e184
New translations policies.md (Chinese Simplified)
DBojsen Mar 31, 2026
18d54b3
New translations preferences.md (Chinese Simplified)
DBojsen Mar 31, 2026
0e2d50f
New translations supported-files.md (Chinese Simplified)
DBojsen Mar 31, 2026
b7c3e59
New translations security-privacy.md (Chinese Simplified)
DBojsen Mar 31, 2026
8b87478
New translations maintaining-calculations-using-scripting.md (Chinese…
DBojsen Mar 31, 2026
1f9c9ef
New translations calendars.md (Chinese Simplified)
DBojsen Mar 31, 2026
8fc467f
New translations direct-lake-guidance.md (Chinese Simplified)
DBojsen Mar 31, 2026
b5900fc
New translations incremental-refresh-about.md (Chinese Simplified)
DBojsen Mar 31, 2026
171aaba
New translations udfs.md (Chinese Simplified)
DBojsen Mar 31, 2026
05c604c
New translations built-in-bpa-rules.md (Chinese Simplified)
DBojsen Mar 31, 2026
2cf4e3c
New translations save-with-supporting-files.md (Chinese Simplified)
DBojsen Mar 31, 2026
8cfaafd
New translations semantic-bridge-metric-view-object-model.md (Chinese…
DBojsen Mar 31, 2026
63aa17a
New translations semantic-bridge.md (Chinese Simplified)
DBojsen Mar 31, 2026
855ce84
New translations index.md (Chinese Simplified)
DBojsen Mar 31, 2026
c35fbf6
New translations composite-model-measure-formatting.md (Chinese Simpl…
DBojsen Mar 31, 2026
8975fbe
New translations databricks-column-comments-length.md (Chinese Simpli…
DBojsen Mar 31, 2026
7c565be
New translations ai-assistant.md (Chinese Simplified)
DBojsen Mar 31, 2026
a33f7be
New translations bpa-udf-use-compound-names.md (Chinese Simplified)
DBojsen Mar 31, 2026
0ac35e1
New translations 3_26_0.md (Chinese Simplified)
DBojsen Mar 31, 2026
485a18b
New translations tmdl.md (Chinese Simplified)
DBojsen Mar 31, 2026
992a8a2
New translations shortcuts3.md (Chinese Simplified)
DBojsen Mar 31, 2026
227d8e4
New translations command-line-options.md (Spanish)
DBojsen Mar 31, 2026
871b9ea
New translations _ui-strings.json (Spanish)
DBojsen Mar 31, 2026
133452e
New translations preferences.md (Chinese Simplified)
DBojsen Mar 31, 2026
8bb1491
New translations security-privacy.md (Chinese Simplified)
DBojsen Mar 31, 2026
76aee6d
New translations calendars.md (Chinese Simplified)
DBojsen Mar 31, 2026
f46557a
New translations _ui-strings.json (Chinese Simplified)
DBojsen Mar 31, 2026
16de402
New translations command-line-options.md (Chinese Simplified)
DBojsen Mar 31, 2026
58ceb78
New translations code-actions.md (Chinese Simplified)
DBojsen Mar 31, 2026
961406c
New translations creating-macros.md (Chinese Simplified)
DBojsen Mar 31, 2026
f49971d
New translations deployment.md (Chinese Simplified)
DBojsen Mar 31, 2026
663e446
New translations metadata-translation-editor.md (Chinese Simplified)
DBojsen Mar 31, 2026
45f299d
New translations perspective-editor.md (Chinese Simplified)
DBojsen Mar 31, 2026
3969cd5
New translations diagram-view.md (Chinese Simplified)
DBojsen Mar 31, 2026
bbeaf0b
New translations user-interface.md (Chinese Simplified)
DBojsen Mar 31, 2026
7e4c6c2
New translations editions.md (Chinese Simplified)
DBojsen Mar 31, 2026
e4813f8
New translations preferences.md (Spanish)
DBojsen Mar 31, 2026
94934cd
New translations csharp-scripts.md (Chinese Simplified)
DBojsen Mar 31, 2026
b156e4a
New translations tom-explorer-view.md (Chinese Simplified)
DBojsen Mar 31, 2026
585902d
escape charaters
mlonsk Mar 31, 2026
25feee7
Merge branch 'localization' of https://github.com/TabularEditor/Tabul…
mlonsk Mar 31, 2026
fe12cee
New translations script-create-and-replace-m-parameter.md (Spanish)
DBojsen Mar 31, 2026
08e5072
New translations useful-script-snippets.md (Spanish)
DBojsen Mar 31, 2026
8bb2452
New translations index.md (Chinese Simplified)
DBojsen Mar 31, 2026
bd3e644
New translations best-practice-analyzer.md (Chinese Simplified)
DBojsen Mar 31, 2026
3f63dd4
New translations script-add-databricks-metadata-descriptions.md (Chin…
DBojsen Mar 31, 2026
3724f35
New translations script-convert-dlsql-to-dlol.md (Chinese Simplified)
DBojsen Mar 31, 2026
51df6ea
New translations csharp-script-library-advanced.md (Chinese Simplified)
DBojsen Mar 31, 2026
b84e762
New translations direct-lake-sql-model.md (Chinese Simplified)
DBojsen Mar 31, 2026
b68d0ef
New translations useful-script-snippets.md (Chinese Simplified)
DBojsen Mar 31, 2026
94c0e4b
New translations workspace-database.md (Chinese Simplified)
DBojsen Mar 31, 2026
f5b0940
New translations script-convert-dlol-to-import.md (Chinese Simplified)
DBojsen Mar 31, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion content/features/code-actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ The Code Actions below will appear with teal green dots under the first two char
| DR011 | [Rewrite using ISBLANK](xref:DR011) | Instead of comparing an expression with [`BLANK()`](https://dax.guide/BLANK), use the [`ISBLANK`](https://dax.guide/ISBLANK) function. Example:<br>`IF([Sales] = BLANK(), [Budget], [Sales])` -> `IF(ISBLANK([Sales], [Budget], [Sales])` |
| DR012 | [Remove unnecessary BLANK](xref:DR012) | Some DAX functions, such as [`IF`](https://dax.guide/IF) and [`SWITCH`](https://dax.guide/SWITCH) already return `BLANK()` when the condition is false, so there is no need to explicitly specify `BLANK()`. Example:<br>`IF(a > b, a, BLANK())` -> `IF(a > b, a)` |
| DR013 | [Simplify negated logic](xref:DR013) | When a logical expression is negated, it is often more readable to rewrite the expression using the negated operator. Example:<br>`NOT(a = b)` -> `a <> b` |
| DR014 | [Simplify using IN](xref:DR014) | Rewrite compound predicates (equality comparisons of the same expression that are combined using [`OR`](https://dax.guide/OR) or [`||`](https://dax.guide/op/or/)) with the [`IN`](https://dax.guide/IN) operator. Example:<br>`a = 1 || a = 2 || a = 100` -> `a IN { 1, 2, 100 }` |
| DR014 | [Simplify using IN](xref:DR014) | Rewrite compound predicates (equality comparisons of the same expression that are combined using [`OR`](https://dax.guide/OR) or [`\|\|`](https://dax.guide/op/or/)) with the [`IN`](https://dax.guide/IN) operator. Example:<br>`a = 1 \|\| a = 2 \|\| a = 100` -> `a IN { 1, 2, 100 }` |

### Rewrites

Expand Down
11 changes: 10 additions & 1 deletion localizedContent/es/content/_ui-strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,14 @@
"themeAuto": "Automático",
"changeTheme": "Cambiar tema",
"copy": "Copiar",
"downloadPdf": "Descargar PDF"
"downloadPdf": "Descargar PDF",
"search": "Buscar documentación",
"note": "Nota",
"warning": "Advertencia",
"tip": "Consejo",
"important": "Importante",
"caution": "Precaución",
"tableOfContents": "Tabla de contenidos",
"selectLanguage": "Seleccionar idioma",
"copyCode": "Copiar código"
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,69 +26,69 @@ Si quieres reemplazar una cadena en las particiones M del modelo (por ejemplo, l
### Crear un nuevo parámetro M y agregarlo a las particiones M existentes

```csharp
// Este script crea un nuevo parámetro M como una 'expresión compartida'.
// También buscará el valor predeterminado en todas las particiones M y lo reemplazará por el nombre del objeto del parámetro.
// This script creates a new M Parameter as a 'Shared Expression'.
// It will also find the default value in all M partitions and replace them with the parameter object name.
//#r "System.Drawing"

using System.Drawing;
using System.Text.RegularExpressions;
using System.Windows.Forms;

// Ocultar el control giratorio de 'Running Macro'
// Hide the 'Running Macro' spinbox
ScriptHelper.WaitFormVisible = false;

// Inicializar variables
// Initialize variables
string _ParameterName = "New Parameter";
string _ParameterValue = "ParameterValue";

// Cuadro de diálogo de WinForms para obtener el nombre/valor del parámetro
// WinForms prompt to get Parameter Name / Value input
using (Form prompt = new Form())
{
Font formFont = new Font("Segoe UI", 11);

// Configuración del cuadro de diálogo
// Prompt config
prompt.AutoSize = true;
prompt.MinimumSize = new Size(380, 120);
prompt.Text = "Crear nuevo parámetro M";
prompt.Text = "Create New M Parameter";
prompt.StartPosition = FormStartPosition.CenterScreen;

// Buscar: etiqueta
Label parameterNameLabel = new Label() { Text = "Escribe el nombre:" };
// Find: label
Label parameterNameLabel = new Label() { Text = "Enter Name:" };
parameterNameLabel.Location = new Point(20, 20);
parameterNameLabel.AutoSize = true;
parameterNameLabel.Font = formFont;

// Cuadro de texto para introducir el texto de la subcadena
// Textbox for inputing the substring text
TextBox parameterNameBox = new TextBox();
parameterNameBox.Width = 200;
parameterNameBox.Location = new Point(parameterNameLabel.Location.X + parameterNameLabel.Width + 20, parameterNameLabel.Location.Y - 4);
parameterNameBox.SelectedText = "New Parameter";
parameterNameBox.Font = formFont;

// Reemplazar: etiqueta
Label parameterValueLabel = new Label() { Text = "Escribe el valor:" };
// Replace: label
Label parameterValueLabel = new Label() { Text = "Enter Value:" };
parameterValueLabel.Location = new Point(parameterNameLabel.Location.X, parameterNameLabel.Location.Y + parameterNameLabel.Height + 20);
parameterValueLabel.AutoSize = true;
parameterValueLabel.Font = formFont;

// Cuadro de texto para introducir el texto de la subcadena
// Textbox for inputting the substring text
TextBox parameterValueBox = new TextBox() { Left = parameterValueLabel.Right + 20, Top = parameterValueLabel.Location.Y - 4, Width = parameterNameBox.Width };
parameterValueBox.SelectedText = "Parameter Value";
parameterValueBox.Font = formFont;

// Botón Aceptar
Button okButton = new Button() { Text = "Crear", Left = 20, Width = 75, Top = parameterValueBox.Location.Y + parameterValueBox.Height + 20 };
// OK Button
Button okButton = new Button() { Text = "Create", Left = 20, Width = 75, Top = parameterValueBox.Location.Y + parameterValueBox.Height + 20 };
okButton.MinimumSize = new Size(75, 25);
okButton.AutoSize = true;
okButton.Font = formFont;

// Botón Cancelar
Button cancelButton = new Button() { Text = "Cancelar", Left = okButton.Location.X + okButton.Width + 10, Top = okButton.Location.Y };
// Cancel Button
Button cancelButton = new Button() { Text = "Cancel", Left = okButton.Location.X + okButton.Width + 10, Top = okButton.Location.Y };
cancelButton.MinimumSize = new Size(75, 25);
cancelButton.AutoSize = true;
cancelButton.Font = formFont;

// Acciones de los botones
// Button actions
okButton.Click += (sender, e) => { _ParameterName = parameterNameBox.Text; _ParameterValue = parameterValueBox.Text; prompt.DialogResult = DialogResult.OK; };
cancelButton.Click += (sender, e) => { prompt.DialogResult = DialogResult.Cancel; };

Expand All @@ -102,11 +102,11 @@ using (Form prompt = new Form())
prompt.Controls.Add(okButton);
prompt.Controls.Add(cancelButton);

// El usuario hizo clic en Aceptar, así que se ejecuta la lógica de buscar y reemplazar
// The user clicked OK, so perform the find-and-replace logic
if (prompt.ShowDialog() == DialogResult.OK)
{

// Crea el parámetro
// Creates the parameter
Model.AddExpression(
_ParameterName,
@"
Expand All @@ -120,21 +120,21 @@ using (Form prompt = new Form())
);


// Informa al usuario de que el parámetro se creó correctamente
// Informs the user that the parameter was successfully created
Info (
"Se creó correctamente un nuevo parámetro: " + @"""" +
"Successfully created a new parameter: " + @"""" +
_ParameterName + @"""" +
"\nValor predeterminado: " + @"""" +
"\nDefault value: " + @"""" +
_ParameterValue + @"""");


// Busca el valor predeterminado del parámetro en las particiones M y lo reemplaza por el nombre del parámetro
// Finds the parameter default value in M Partitions & replaces with the parameter name
string _Find = @"""" + _ParameterValue + @"""";
string _Replace = @"#""" + _ParameterName + @"""";

int _NrMPartitions = 0;
int _NrReplacements = 0;
var _ReplacementsList = new List<string>();
var _ReplacementsList = new List<0>();

foreach ( var _Tables in Model.Tables )
{
Expand All @@ -146,43 +146,43 @@ using (Form prompt = new Form())
{
_p.Expression = _p.Expression.Replace( _Find, _Replace );

// Lleva el control de qué particiones M se reemplazaron (y cuántas)
// Tracks which M partitions were replaced (and how many)
_NrReplacements = _NrReplacements + 1;
_ReplacementsList.Add( _p.Name );
}

// Cuenta el total de particiones M
// Counts the total # M Partitions
_NrMPartitions = _NrMPartitions + 1;
}
}
}


// Crea una lista con viñetas de todas las particiones M que se reemplazaron
// Makes a bulleted list of all the M partitions that were replaced
string _ReplacedPartitions = " • " + String.Join("\n • ", _ReplacementsList );


// Informa
// - Si la búsqueda y el reemplazo se realizaron correctamente
// - Cuántas particiones M se reemplazaron
// - En qué particiones M se aplicó la búsqueda y el reemplazo
// Informs
// - Whether the Find & Replace was successful
// - How many M partitions were replaced
// - Which M partitions had the Find & Replace done
Info (
"Se reemplazó correctamente\n\n " +
"Successfully replaced\n\n " +
_Find +
"\n\n por: \n\n" +
"\n\n with: \n\n" +
_Replace +
"\n\n en " +
"\n\n in " +
Convert.ToString(_NrReplacements) +
" de " +
" of " +
Convert.ToString(_NrMPartitions) +
" particiones M:\n" +
" M Partitions:\n" +
_ReplacedPartitions
);

}
else
{
Error ( "Entrada cancelada. El script finalizó sin cambios.");
Error ( "Cancelled input! Ended script without changes.");
}
}
```
Expand All @@ -199,6 +199,5 @@ Luego buscará el valor predeterminado en todas las particiones M y lo reemplaza
</figure>

<figure style="padding-top: 15px;">
<img class="noscale" src="~/content/assets/images/Cscripts/script-create-parameter-auto-replace.png" alt="Data Security Create Role" style="width: 550px;"/><figcaption style="font-size: 12px; padding-top: 10px; padding-bottom: 15px; padding-left: 75px; padding-right: 75px; color:#00766e"><strong>Figura 2:</strong> Cuadro de diálogo de confirmación que muestra que se ha creado el parámetro y que la subcadena de valor correspondiente se ha reemplazado en todas las expresiones de las particiones M. Para parámetros de otros tipos, ajusta el código C# según corresponda.</figcaption>
Para parámetros de otros tipos, ajusta el código C# según corresponda.</figcaption>
<img class="noscale" src="~/content/assets/images/Cscripts/script-create-parameter-auto-replace.png" alt="Data Security Create Role" style="width: 550px;"/><figcaption style="font-size: 12px; padding-top: 10px; padding-bottom: 15px; padding-left: 75px; padding-right: 75px; color:#00766e"><strong>Figura 2:</strong> Cuadro de diálogo de confirmación que muestra que se ha creado el parámetro y que la subcadena de valor correspondiente se ha reemplazado en todas las expresiones de las particiones M. Para parámetros de otros tipos, ajusta el código C# según corresponda.</figcaption> Para parámetros de otros tipos, ajusta el código C# según corresponda.</figcaption>
</figure>
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Para usar el script, selecciona la columna de fecha de la tabla para la que quie
> Asegúrate de comprobar que se ha hecho correctamente.
>
> Si tienes muchos pasos, asegúrate de mover este paso a un punto en el que pueda plegarse hasta la fuente de datos.
> Asegúrate de ajustar todas las \\`#"Step References" en Power Query
> Asegúrate de ajustar todas las \`#"Step References" en Power Query

> [!NOTE]
> Este script usa la entrada del usuario para generar la política de actualización.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ author: Morten Lønskov
updated: 2023-02-23
---

# Biblioteca de scripts de C\\#
# Biblioteca de scripts de C\#

![Biblioteca de scripts de C#](~/content/assets/images/Cscripts/script-library-header.png)

Expand Down
Loading