User Tools

Site Tools


Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
en:process_steps:worksheet:wsheet_use [2021/04/30 17:38]
tiger [WSheet Use]
en:process_steps:worksheet:wsheet_use [2024/02/18 01:56] (current)
tiger
Line 1: Line 1:
 {{indexmenu_n>1}} {{indexmenu_n>1}}
 ====== WSheet Use ====== ====== WSheet Use ======
- 
-**See the older version of this step (before May 2021) below**  
  
 WSheet Use is the most frequent process step in Djeeni to tell that the process has something to do with a worksheet. It does much more than just 'open' an existing workbook with a specified worksheet in it: WSheet Use is the most frequent process step in Djeeni to tell that the process has something to do with a worksheet. It does much more than just 'open' an existing workbook with a specified worksheet in it:
   * Based on settings it can also create a new worksheet in an existing workbook; even further it can create a new workbook with the first worksheet;   * Based on settings it can also create a new worksheet in an existing workbook; even further it can create a new workbook with the first worksheet;
-  * It can use a template //worksheet// (unlike MS Excel that can only use a template workbook) to prefill the cells of the worksheet with formulas or data; +  * It can use a template //worksheet// (unlike MS Excel that can only use a template workbook) to prefill the cells of the worksheet with formulas, formatting or data; 
-  * You can assign a logical Djeeni name to it that makes your process much more readable and understandable;+  * You can assign a friendly Djeeni name to it that makes your process much more readable and understandable; 
 +  * It works with CSV (Comma Separated Value) files, too
   * Last but not least you can define a dynamic name to the workbook and worksheet using Djeeni formulas.   * Last but not least you can define a dynamic name to the workbook and worksheet using Djeeni formulas.
  
 The WSheet Use process step has these parameters The WSheet Use process step has these parameters
   * **Worksheet Djeeni name**: this name identifies the worksheet in the process   * **Worksheet Djeeni name**: this name identifies the worksheet in the process
-  * **Worksheet Excel name**: name of the worksheet as displayed in Excel. The speciality of Djeeni that it understands if you only specify here the sheet number of an existing worksheet in the workbook. Quite frequently we work with workbooks with just one or a few worksheets. You can fill this parameter e.g. with 1 and Djeeni will use the first worksheet in the workbook - does not matter how it is called. Very handy if you work in an international environment or use export files from IT systems with dynamic worksheet names.+  * **Worksheet Excel name**: name of the worksheet as displayed in Excel. The specialty of Djeeni that it understands if you only specify here the sheet number of an existing worksheet in the workbook. Quite frequently we work with workbooks with just one or a few worksheets. You can fill this parameter e.g. with 1 and Djeeni will use the first worksheet in the workbook - does not matter how it is called. Very handy if you work in an international environment or use export files from IT systems with dynamic worksheet names.
   * **From workbook**: The physical location (path) of the workbook to be used:   * **From workbook**: The physical location (path) of the workbook to be used:
     * it can be a fixed path like C:\finance\budget\2020\plan.xlsx; but      * it can be a fixed path like C:\finance\budget\2020\plan.xlsx; but 
     * you can specify dynamic path like c:\finance\budget\[=wsSettings!B4]\plan.xlsx to use a value from another (parameter) worksheet; in this case the value of cell B4 from the worksheet identified by the Djeeni name wsSettings; or     * you can specify dynamic path like c:\finance\budget\[=wsSettings!B4]\plan.xlsx to use a value from another (parameter) worksheet; in this case the value of cell B4 from the worksheet identified by the Djeeni name wsSettings; or
     * even combine Excel functions with Djeeni formulas like c:\finance\budget\[+FORMAT(TODAY(),"yyyy")]\actual.xlsx to access the current year folder on the day the process runs.     * even combine Excel functions with Djeeni formulas like c:\finance\budget\[+FORMAT(TODAY(),"yyyy")]\actual.xlsx to access the current year folder on the day the process runs.
-  * **File type**: Djeeni currently supports standard XLSX and CSV (Comma Separated Values) files. We are continuously expanding the covered file types. +  * **File type**: Djeeni currently supports standard XLSX, XLS and CSV (Comma Separated Values) or TXT files. We are continuously expanding the covered file types. 
-  * **Using Template**: Fill this optional parameter if you want to copy the content of another worksheet to it. It can be used only for Target worksheets (see the next parameter). The template data will overwrite the existing content. If you use it then you should follow the Excel syntax by adding the worksheet Excel name behind the workbook path separated by an exclamation mark. Example: if you want to use the worksheet **EmptyBudget** from the workbook **c:\finance\templates\budget.xlsx** then this parameter gets the value **c:\finance\templates\budget.xlsx!EmptyBudget**.+  * **Using Template**: Fill this optional parameter if you want to copy the content and formatting of another worksheet to it. It can be used only for Target worksheets (see the next parameter). The template data will overwrite the existing content. If you use it then you should follow the Excel syntax by adding the worksheet Excel name behind the workbook path separated by an exclamation mark. Example: if you want to use the worksheet **EmptyBudget** from the workbook **c:\finance\templates\budget.xlsx** then this parameter gets the value **c:\finance\templates\budget.xlsx!EmptyBudget**.
   * **Use worksheet as**: You can choose from Source and Target. Source worksheets will be protected by Djeeni and their data will not be accidentally overwritten or otherwise modified. Target worksheets can still be used to read data from them for processing.   * **Use worksheet as**: You can choose from Source and Target. Source worksheets will be protected by Djeeni and their data will not be accidentally overwritten or otherwise modified. Target worksheets can still be used to read data from them for processing.
   * **Target worksheet Exists / Not exists action**: It can be specified what should happen if a target worksheet already exists or does not exist yet. Possible settings:   * **Target worksheet Exists / Not exists action**: It can be specified what should happen if a target worksheet already exists or does not exist yet. Possible settings:
-    * //If worksheet does exist then use it as is; If worksheet does not exist then stop with error:// this option is useful when we want to add data to an existing worksheet +    * **Fill (Use as is/Error): ** //If the worksheet does exist then use it as is; If the worksheet does not exist then stop with error:// this option is useful when we want to add data to an existing worksheet 
-    * //If worksheet does exist then use it as is; If worksheet does not exist then create it:// this option is useful when we want to create a worksheet and then add data to it (e.g. start a new worksheet every month and then add daily data to it) +    * **Append (Use as is/Create): **//If the worksheet does exist then use it as is; If the worksheet does not exist then create it:// this option is useful when we want to create a worksheet and then add data to it (e.g. start a new worksheet every month and then add daily data to it) 
-    * //If worksheet does exist then delete and recreate it; If worksheet does not exist then create it:// this option is useful when we want to create the worksheet always from scratch (e.g. if the source is modified after an error is discovered in it then everything should be reprocessed again) +    * **Overwrite(Delete and Recreate/Create): **//If the worksheet does exist then delete and recreate it; If the worksheet does not exist then create it:// this option is useful when we want to create the worksheet always from scratch (e.g. if the source is modified after an error is discovered in it then everything should be reprocessed again) 
-    * //If worksheet does exist then stop with Error; If worksheet does not exist then create it:// this option avoids accidentally overwriting an existing worksheet (probably an older version that must be kept) +    * **Create(Error/Create): **//If the worksheet does exist then stop with Error; If the worksheet does not exist then create it:// this option avoids accidentally overwriting an existing worksheet (probably an older version that must be kept) 
-  * **Options**: Future settings like updating links of the worksheet upon opening itAdding possible passwords for password protected workbooks.+  * **Options**: You can alter the behaviour of WSheet Use by specifying one or more of the following options separated by **;**: 
 +    * **UpdateLinks**: When the worksheet is opened the data from external links will be updated 
 +    * **CSV:**: If you import a CSV (Comma Separated Value) file then you can specify its structure using a 6-character string as follows: 
 +      * First position:  The character that separates the values within a row. It can be a comma (**,**), a semicolon (**;**), a space (**s**), a tab (**t**) or a custom character. 
 +      * Second position: The character that encloses string values. It can be a double quote (**"**), a single quote (**'**) or none (**-**)  
 +      * Third position: The decimal separator in numbers. It can be a dot (**.**) or a comma (**,**) 
 +      * Fourth position: The thousand separator in numbers. It can be a dot (**.**), a comma (**,**) or a space (**s**) 
 +      * Fifth position: If the CSV file comes with Windows (**w**) or Macintosh (**m**) format 
 +      * Sixth position: If the negative sign can come after numbers in values. It can be yes (**-**) or no (**+**) 
 +      * Note the **:** between the option name CSV and the value. It is an error to omit this **:**; you can use space before and after the **:**, though. 
 +      * Default: if a CSV file is imported and the CSV option is not provided then the default value is **CSV:,".,w+**, i.e. the values are separated by the comma, the string values are enclosed in double quotes, the decimal separator of numbers is the dot, the thousand separator for numbers is the comma, the file is encoded in Windows, and the negative sign of negative numbers must not appear behind the numbers. 
 + 
 + 
 +===== Examples ===== 
 + 
 +==== Opening an existing worksheet ==== 
 + 
 +The worksheet does exist and its workbook has a (possibly dynamic) location therefore the workbook path and the Excel name are known. Also it is known if the worksheet is used only as a data source or will also be modified (target). In case of the **Target** value is set then the Target action parameter can be set to **Exists: use as is / Not Exists: Error**. 
 + 
 +==== Adding a new worksheet to an existing workbook ==== 
 + 
 +As it will be a new worksheet the **Use worksheet as** parameter must be set to **Target**. The **Target worksheet Exists / Not exists action** can have two values: either **Delete and Recreate / Create** or **Error / Create**. You do not have to take care of the workbook. If the workbook does exist then Djeeni simply uses it. If the workbook does not exist then Djeeni will create it as your request to have a new worksheet in this workbook implies that the workbook also must exist.
  
-===== WSheet Use - older version =====+==== Creating a new workbook with its first worksheet ====
  
-WSheet Use is an acronym for worksheet use - in this process step the user can specify the worksheet and the workbook that will be used in the next steps of the process and define the parameters, such as writing permissions (declaring the worksheet either as a source or a target), updating links and passwords.+When you want to create a new workbook with one worksheet, you only have to take care of the worksheet as Djeeni recognizes the missing workbook and creates it automatically. Fill the parameters according to the [[#Adding a new worksheet to an existing workbook]] section.
  
-{{djeeni:wsheet_use.png}}+==== Opening a CSV file ====
  
-Every worksheet that is used during a process (either source or target) should be declared within Djeeni with the following parameters: +CSV files contain exactly one 'worksheet'. Unlike MS Excel, Djeeni lets you give this worksheet an Excel name next to its Djeeni name but currently it has no use (future versions may utilize it). Simply specify the Excel name parameter as 1Choose the File Type parameter value 'csv'CSV files can only be Source. Specify the **CSV:** option to avoid incorrect import.
-  * **Worksheet Djeeni name:** this name identifies the worksheet during the process +
-  * **Workbook folder:** The physical location of the workbook to be used +
-  * **Workbook name (without filetype/extension):** the name of the workbook file +
-  * **Workbook filetype/extension:** the extension, identifying the version of an excel document (either .xls or .xlsx) +
-  * **Worksheet Excel name:** name of the worksheet as displayed in Excel that you would like to use +
-  * **Use worksheet as:** here you can either choose Source or Target (default)Source worksheets are not allowed to be modified so Djeeni protects your data sources from accidentally being overwrittenTarget worksheets on the other hand can be modified in consecutive process steps +
-  * **Update links in the workbook?:** If links in the workbook must be updated before using itYes (default) / No +
-  * **If Target then worksheet action:** It can be decided what should happen if the worksheet already exists or does not yet exist. Possible settings: +
-    * //If worksheet does exist then use it as is; If worksheet does not exist then stop with error:// this option is useful when we want to add data to an existing worksheet +
-    * //If worksheet does exist then use it as is; If worksheet does not exist then create it:// this option is useful when we want to create a worksheet and then add data to it (e.g. start a new worksheet every month and then add daily data to it) +
-    * //If worksheet does exist then delete and recreate it; If worksheet does not exist then create it:// this option is useful when we want to create the worksheet always from scratch (e.g. if the source is modified after an error is discovered in it then everything should be reprocessed again) +
-    * //If worksheet does exist then stop with Error; If worksheet does not exist then create it:// this option avoids accidentally overwriting an existing worksheet +
-  * **Workbook open password (Optional):** Password for opening the containing workbook  +
-  * **Workbook write-reserved password (Optional):** Password for writing the containing workbook +
  
 +{{ :en:process_steps:worksheet:wsheetuse.png?nolink&800 |}}