9afaa9717c9b5cd94e8d1b36cd812d0f460213c8
FAQ/UserGuides/15.4-Expression-Functions.md
| ... | ... | @@ -1,42 +1,181 @@ |
| 1 | -#15.4 Expression Functions |
|
| 1 | +#4.0 Fields Tab |
|
| 2 | 2 | |
| 3 | -### Functions |
|
| 3 | +[[_TOC_]] |
|
| 4 | 4 | |
| 5 | -As you may have noticed, we can use some aggregate functions in expressions. In order to prevent SQL injection, only a limited set of SQL functions are turned on by default. |
|
| 5 | +##About |
|
| 6 | 6 | |
| 7 | -- avg(OrderID) produces the average of all OrderID values. |
|
| 7 | +The Fields tab is where the actual report is built. This tab allows you to define which fields from your Data Source that will be included in your report and any grouping, sorting, and totaling that needs to be performed. There are a multitude of options that are available to users from this tab. Listed below is a brief description of the properties available on the Fields tab. |
|
| 8 | 8 | |
| 9 | -- cast(OrderID, AS DATATYPE) ``e.g. "cast([OrderID] as varchar)"`` Converts a value from one data type to another. This should only be done when you do not want to make a permanent change to the data type, such as converting numeric to strings and concatenating them. |
|
| 9 | +![]() |
|
| 10 | 10 | |
| 11 | -- convert (DATATYPE, [OrderID]) ``e.g. "convert(varchar, [OrderID])"`` |
|
| 11 | +|**Feature**|**Description**| |
|
| 12 | +|:---------:|:-------------:| |
|
| 13 | +|Field Selection|Select fields from the drop-down menu or use the Quick Add button| |
|
| 14 | +|Description|Displays a new title for the Field| |
|
| 15 | +|Sort |Sorts A - Z| |
|
| 16 | +|VG |Visually Groups the Field| |
|
| 17 | +|A|Arithmetic – Performs basic calculations (+, -, *, %) and concatenation of text. | |
|
| 18 | +|Function|Displays functions available based on the type of data being accessed. | |
|
| 19 | +|Format|Displays the formats available to be displayed based on the data type.| |
|
| 20 | +|Other buttons|On the far right you can delete, insert, move, or set advanced properties.| |
|
| 21 | +|Records|Sets the number of records to display, which is used many times to add a Top to the query result, such as Top 10 Customers by Revenue||Add Sub-total|Adds a sub-total to the report under each numeric column| |
|
| 22 | +|Add Side-total|Adds a side-total to the report beside each numeric row| |
|
| 23 | +|Quick Add|Lets you quickly add multiple fields to the report at one time | |
|
| 24 | +|Add Pivot |Displays the pivot controls. Learn more about [[pivots|]].| |
|
| 25 | +|Continue to Summary|Continues to the next tab in the report design process, the Summary tab. | |
|
| 12 | 26 | |
| 13 | -More information about using these functions can be found [[here|http://msdn.microsoft.com/en-us/library/aa226054(v=sql.80).aspx]] and [[here|http://dev.mysql.com/doc/refman/5.5/en/cast-functions.html#function_cast]] |
|
| 27 | +##4.1 Field Dropdown Menu |
|
| 14 | 28 | |
| 15 | -- count(OrderID) produces a count of all OrderID values. |
|
| 29 | +The **Field** dropdown menu is a list of the available fields in the table(s)/view(s) that are selected on the **Data Sources** tab. When working with multiple tables/views, the fields are categorized according to which Data Source they come from. The entries in the list that are in **Bold** are the table/datasource names. |
|
| 16 | 30 | |
| 17 | -- distinct(OrderID) produces a list of all distinct OrderID values. |
|
| 31 | +![]() |
|
| 18 | 32 | |
| 19 | -- isnull(OrderID, x) checks to see if there is a null value in OrderID and replaces it with ‘x’. |
|
| 33 | +**Additional Options** |
|
| 20 | 34 | |
| 21 | -- length(OrderID) returns the length of a string. Length is used with an Oracle db. If you’re using SQL, see len(OrderID). |
|
| 35 | +* [[ShowDatabaseTypes|/API/CodeSamples/ShowDatabaseTypes]]. |
|
| 22 | 36 | |
| 23 | -- len(OrderID) returns the length of a string. Len is used with a SQL db. If you’re using Oracle, see length(OrderID). |
|
| 37 | +##4.2 Description |
|
| 24 | 38 | |
| 25 | -- max(OrderID) produces the maximum OrderID value within a given range. |
|
| 39 | +Automatically Inputs the name of the associated Field. You have the option to change the description and it will appear as the new title when displayed. |
|
| 26 | 40 | |
| 27 | -- min(OrderID) produces the minimum OrderID value within a given range. |
|
| 41 | +![]() |
|
| 28 | 42 | |
| 29 | -- round(OrderID, x) takes a decimal value and rounds it to x digits. |
|
| 43 | +**Additional Options** |
|
| 30 | 44 | |
| 31 | -- sum(OrderID) produces the sum of all OrderID values. |
|
| 45 | +* [[DescriptionWidth|/API/CodeSamples/DescriptionWidth]] |
|
| 32 | 46 | |
| 33 | -It is possible to enable other SQL functions or write new functions. Please see this link to our knowledge base for instructions: |
|
| 47 | +##4.3 Sort, VG, & Arithmetic Check Boxes |
|
| 34 | 48 | |
| 35 | -http://www.izenda.com/Site/CodeSample/CodeSample.aspx?setting=ExtendedFunctions |
|
| 49 | +![]() |
|
| 36 | 50 | |
| 51 | +The following table explains the Sort, Group, and VG Check Box features. |
|
| 37 | 52 | |
| 38 | ---- |
|
| 53 | +|**Features**|**Description**| |
|
| 54 | +|:----------:|:-------------:| |
|
| 55 | +|Sort check box| |
|
| 56 | +Check this box if you want the table/view to be sorted by the field selected in the Field dropdown menu to the left in ascending order.| |
|
| 57 | +|Sort (z-a) under Advanced| |
|
| 58 | +This check box is in the advanced properties of the row and can be set if you want the table/view to be sorted by the field selected in the Field dropdown menu to the left in descending order.| |
|
| 59 | +|VG check box| |
|
| 60 | +Check this box to change the column for the field selected in the Field dropdown menu to the left into subheadings.| |
|
| 61 | +|Arithmetic| |
|
| 62 | +Arithmetic. Performs basic calculations (+, -, x, %) and concatenation of text. More about [[Calculated Fields|/FAQ/Questions/Using Calculated Fields]]| |
|
| 39 | 63 | |
| 40 | -[[15.0 Expressions in Izenda]] |
|
| 64 | +##4.4 Other Buttons on the Fields Tab |
|
| 41 | 65 | |
| 42 | -[[User Guides|http://wiki.izenda.us/FAQ/UserGuides]] |
|
| ... | ... | \ No newline at end of file |
| 0 | +The , , and  |
|
| 1 | + |
|
| 2 | +![Functions Buttons]() |
|
| 3 | + |
|
| 4 | +Below is a table that describes the function buttons of the Fields tab. |
|
| 5 | + |
|
| 6 | +|**Icon**|**Control Name**|**Description**| |
|
| 7 | +|:--:|:----------:|:---------:| |
|
| 8 | +||Delete button|Click this button to delete the row the button is on.| |
|
| 9 | +||Insert Row button (above)|Click this button to insert a row above the row the button is on.| |
|
| 10 | +||Insert Row button (below)|Click this button to insert a row below the row the button is on.| |
|
| 11 | +||Move|Allows user to move a row up or down in the list| |
|
| 12 | +||Advanced Properties|Advanced properties for that row.| |
|
| 13 | + |
|
| 14 | +##4.5 Functions Drop-Down |
|
| 15 | + |
|
| 16 | +Functions allow you to perform calculations on the data and can be chosen from the dropdown menu based on the data type of the selected Field. Here is an [[article on SQL Functions|http://www.w3schools.com/sql/sql_functions.asp]] |
|
| 17 | + |
|
| 18 | +**Text (String) Functions Available** |
|
| 19 | + |
|
| 20 | +![]() |
|
| 21 | + |
|
| 22 | +**Date/Time Functions Available** |
|
| 23 | + |
|
| 24 | +![]() |
|
| 25 | + |
|
| 26 | +**Numeric Functions Available** |
|
| 27 | + |
|
| 28 | +![]() |
|
| 29 | + |
|
| 30 | +**Functions Table** |
|
| 31 | + |
|
| 32 | +|Function Name|Description| |
|
| 33 | +|:-----------:|:---------:| |
|
| 34 | +|. . .|No function used| |
|
| 35 | +|Average|Average the values in a column| |
|
| 36 | +|Count|Counts the number of values in a column| |
|
| 37 | +|Count Distinct|Counts the number of distinct values in a column| |
|
| 38 | +|Maximum|Takes Maximum value of a field| |
|
| 39 | +|Minimum|Takes Minimum value of a field| |
|
| 40 | +|Sum|Sums the values in a column | |
|
| 41 | +|Sum Distinct|Sums the rows with distinct values in a column. | |
|
| 42 | +|Group|Groups field values together for aggregating| |
|
| 43 | +|Group(Day)|23; day of month| |
|
| 44 | +|Group(Month)||3; instead of March| |
|
| 45 | +|Group(Year)|2012| |
|
| 46 | +|Group(Month Name)|July| |
|
| 47 | +|Group(Date)|7/4/2012| |
|
| 48 | +|Group(Day of Week)|Sun or Mon| |
|
| 49 | +|Group(Year & Month)|2012 -07| |
|
| 50 | +|Group(Year & MN)|2012 - Jul| |
|
| 51 | +|Group(Week)|Jul 01 – Jul 07 (Sunday to Saturday of Week)| |
|
| 52 | +|Group(Year & Quarter)|2012–Q3| |
|
| 53 | +|Days Old|342 (Number of Days from Today’s Date)| |
|
| 54 | +|Sum(Days Old) |782 (Sums the Number of Days from Todays Date)| |
|
| 55 | + |
|
| 56 | +##4.6 Format Dropdown Menu |
|
| 57 | + |
|
| 58 | +The **Format** dropdown menu is a list of formats for the entries of the field selected in the **Field** dropdown menu directly to the left to appear in. Depending on the Field data type and the function, you will have differing options for formatting. The main two formats used will be available for all numbers and dates. |
|
| 59 | + |
|
| 60 | +![]() |
|
| 61 | + |
|
| 62 | +**Numeric Formats Available** |
|
| 63 | + |
|
| 64 | +|**Format**|**Description**|**Examples**| |
|
| 65 | +|. . .|Displays the number as it is stored in the database|500| |
|
| 66 | +|0,000|Displays as a whole number|500 | |
|
| 67 | +|0,000.00|Displays with two decimal places|$500.00| |
|
| 68 | +|$0.00|Displays as currency with two decimal places|$500.00| |
|
| 69 | +|$/100|Displays the Number / 100 In currency format.|$5.00| |
|
| 70 | +|0.0|Displays with one decimal place|500.0| |
|
| 71 | +|0.00|Displays with two decimal places|500.00| |
|
| 72 | +|0.000|Displays with three decimal places|500.000| |
|
| 73 | +|0%|Displays the number as a percentage|50000%| |
|
| 74 | +|% of Group (with rounding)|Same as % of Group but rounds to closest tenth (ex. 1.11547% would be 1.1%).|100.0% (only one selected value, 500)| |
|
| 75 | +|% of Group|Calculates the percentage of the row value to the entire group of values.|100%| |
|
| 76 | +|Gauge|Shows value in a Linear Gauge instead of a numerical value.|| |
|
| 77 | +|Gauge (variable)|Shows values in a Linear Gauge which changes format due to values.|| |
|
| 78 | +|Dash Gauge|Shows values in a Linear Gauge which changes format due to values.|| |
|
| 79 | + |
|
| 80 | +**Date/Time Formats Available** |
|
| 81 | + |
|
| 82 | +![]() |
|
| 83 | + |
|
| 84 | +|**Format**|**Description**|**Examples**| |
|
| 85 | +|. . . |Displays the date as it exists in the database|7/4/2012 12:00:00 AM| |
|
| 86 | +|Short Date|Displays date using the mm/dd/yyyy format|7/4/2012| |
|
| 87 | +|Long Date|Displays the day of the week, month, numeric day, and the year|Wednesday, July 04, 2012| |
|
| 88 | +|Short Time|Displays time as hh:mm AM/PM|12:00 AM| |
|
| 89 | +|Long Time|Displays time as hh:mm:ss AM/PM|12:00:00 AM| |
|
| 90 | +|Full(short)|Displays the Long Date format, followed by the Short Time format|Wednesday, July 04, 2012 4:34 PM| |
|
| 91 | +|Full(long)|Displays the Long Date format, followed by the Long Time format|Wednesday, July 04, 2012 4:34:52 PM| |
|
| 92 | +|D&T (short)|Displays the Short Date format, followed by the Short Time format|7/4/2012 4:34 PM| |
|
| 93 | +|D&T (long)|Displays the Short Date format, followed by the Long Time format|7/4/2012 4:34:52 PM| |
|
| 94 | + |
|
| 95 | +##4.7 Quick Add |
|
| 96 | + |
|
| 97 | +Quick Add lets you add multiple fields to the report at one time by selecting from a list. |
|
| 98 | + |
|
| 99 | +![]() |
|
| 100 | + |
|
| 101 | +##4.8 Advanced Field Settings Button |
|
| 102 | + |
|
| 103 | +To access the Advanced Field Settings, click on the Gear icon on the selected Field. |
|
| 104 | + |
|
| 105 | +![]() |
|
| 106 | + |
|
| 107 | +|**Setting Name**|**Description**| |
|
| 108 | +|Hide this field|Hides the field from display when report is ran| |
|
| 109 | +|Sort (z-a)|Sorts in descending order| |
|
| 110 | +|Italic – Bold|Italic and Bold for that field| |
|
| 111 | +|Width|Set the width of the column in number of pixels| |
|
| 112 | +|Label Justication|Sets the Column label to the left, right, or middle of the row| |
|
| 113 | +|Value Justication|Sets the Value of the field to the left, right, or middle of the row| |
|
| 114 | +|Subreport|Sets the drill-down child report | |
|
| 115 | +|Drill-Down Style|**Link** – opens in same browser window <br>**Link (New Window)** – opens in new browser window<br>**Embedded** – embeds the drill-down results into the main report<br>**Popup** – opens the results on a pop-up screen |