This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| EVALUATE | |
| VAR __tables = | |
| SELECTCOLUMNS( | |
| INFO.VIEW.TABLES( ), | |
| "ObjectId", [ID], | |
| "ObjectType", "Table", | |
| "Type", "N/A", | |
| "Object", [Name], | |
| "Desc", [Description], | |
| "Hidden", FALSE( ), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (sharepoint_site as text) => | |
| let | |
| Source = OData.Feed(sharepoint_site & "/_api/web/lists", null, [Implementation = "2.0"]), | |
| Select_Columns = Table.SelectColumns(Source, {"Id", "Title", "ListItemEntityTypeFullName"}), | |
| Set_Types = Table.TransformColumnTypes( | |
| Select_Columns, | |
| {{"Id", type text}, {"Title", type text}, {"ListItemEntityTypeFullName", type text}} | |
| ) | |
| in | |
| Set_Types |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (sharepoint_site as text, folder_name as text) => | |
| let | |
| Source = | |
| Record.SelectFields(OData.Feed( | |
| sharepoint_site & "/_api/web/GetFolderByServerRelativeUrl('" & folder_name & "')", | |
| null, | |
| [Implementation = "2.0"] | |
| ), "Files")[Files], | |
| Select_Columns = Table.SelectColumns( | |
| Source, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (sharepoint_site as text, list_title as text) => | |
| let | |
| Source = Record.SelectFields( | |
| OData.Feed( | |
| sharepoint_site & "/_api/lists/getbytitle('" & list_title & "')", | |
| null, | |
| [Implementation = "2.0"] | |
| ), | |
| "Fields" | |
| )[Fields], |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Function AUTOCORR(dataRange As Range, lag As Integer) As Double | |
| Dim n As Long | |
| Dim i As Long | |
| Dim mean As Double | |
| Dim numerator As Double | |
| Dim denominator As Double | |
| Dim values() As Double | |
| ' Get number of points | |
| n = dataRange.Count |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- Using DuckDb | |
| -- Example is Lag 1 | |
| CREATE TEMP TABLE t1 ( | |
| SERIES DECIMAL(18,2) | |
| ); | |
| INSERT INTO t1 VALUES(895); | |
| INSERT INTO t1 VALUES(432); | |
| INSERT INTO t1 VALUES(282); | |
| INSERT INTO t1 VALUES(879); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function Get-RecentFiles { | |
| param ( | |
| [string]$Path = ".", | |
| [int]$Days = 1, | |
| [switch]$Recurse, | |
| [string]$Extension | |
| ) | |
| if (-Not (Test-Path $Path)) { | |
| Write-Error "Path not found: $Path" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Import-Module PSDuckDB | |
| # Start timing | |
| $startTime = Get-Date | |
| # Parameters | |
| $table = "test_table" | |
| $sql = "SELECT * FROM $table" | |
| $output = "Output\QueryResults.csv" | |
| # Create a connection |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Moving Average | |
| #r "Microsoft.VisualBasic" | |
| using Microsoft.VisualBasic; | |
| using System.Text.RegularExpressions; | |
| // Select a measure | |
| var offsetMeasure = Model.SelectMeasure(); | |
| // Select an offset column |