Skip to content

Commit

Permalink
added explanation to the use of isValid function
Browse files Browse the repository at this point in the history
  • Loading branch information
gmansueto committed Apr 6, 2023
1 parent f2fad02 commit 9476743
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions chapter_3/create_dataset/query.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,12 @@ In the script below we use JavaScript to dynamically modify the ``FROM`` clause
:caption: Example of a script in a *Query* dataset
:linenos:
if( isValid('year') == 1997 ) {
query = query.replace('FROM sales_fact_1998', 'FROM sales_fact_1997');
} else {
query = query; // do nothing
}
if(isValid('year')) {
if( parameters.get('year') == 1997 ) {
query = query.replace('FROM sales_fact_1998', 'FROM sales_fact_1997');
} else {
query = query; // do nothing
}
}
In the above example we use the function *isValid* to test if the parameter value contains a not null value.

0 comments on commit 9476743

Please sign in to comment.