|
1 | 1 | [ |
2 | 2 | /* |
| 3 | + Created: 2024-06-04 |
3 | 4 | About: |
4 | 5 | If you're trying to quickly experiment with queries in interactive mode |
5 | | - Then this module gives you short aliases as shorthand |
| 6 | + Then this module gives you alias as shorthand for functions that are useful for debugging |
6 | 7 |
|
7 | | - this should be a self contained file |
| 8 | + Should run without any external functions or dependencies |
8 | 9 | */ |
9 | 10 |
|
10 | 11 | // aliases mainly for interactive use when debugging |
|
29 | 30 | Source = source |
30 | 31 | ], |
31 | 32 |
|
| 33 | + // get an abstract syntax tree |
| 34 | + Ast = (source as any) as nullable record => Value.Expression( source ), |
| 35 | + |
32 | 36 | // always case-insensitive |
33 | 37 | Text.Contains.CI = ( source as nullable text, substring as text) as nullable logical => |
34 | 38 | Text.Contains( source, substring, Comparer.OrdinalIgnoreCase ), |
|
40 | 44 | // stop folding without forcing buffer or index column enumerations |
41 | 45 | StopFold = (source as table) as table => Table.StopFolding(source), |
42 | 46 |
|
| 47 | + // see: https://blog.crossjoin.co.uk/2023/12/10/getting-different-versions-of-data-with-value-versions-in-power-query/ |
| 48 | + Versions = (value as any) as table => Value.Versions( value ), |
| 49 | + // see: https://blog.crossjoin.co.uk/2023/12/10/getting-different-versions-of-data-with-value-versions-in-power-query/ |
| 50 | + Versions.Which = (value as any) as any => Value.VersionIdentity( value ), |
| 51 | + |
43 | 52 | // IIRC this only affects evaluation when using the query editor. so if you have a lot of sketches, this may help there. YMMV |
44 | 53 | TableDelayedBuffer = (source as table) as table => |
45 | 54 | Table.Buffer(source, [ BufferMode = BufferMode.Delayed ] ), |
|
0 commit comments