Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
_qlik_builtins.py667 linesDownload Raw Back to lexers
1"""2    pygments.lexers._qlik_builtins3    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~4 5    Qlik builtins.6 7    :copyright: Copyright 2006-present by the Pygments team, see AUTHORS.8    :license: BSD, see LICENSE for details.9"""10 11# operators12#   see https://help.qlik.com/en-US/sense/August2021/Subsystems/Hub/Content/Sense_Hub/Scripting/Operators/operators.htm13OPERATORS_LIST = {14    "words": [15        # Bit operators16        "bitnot",17        "bitand",18        "bitor",19        "bitxor",20        # Logical operators21        "and",22        "or",23        "not",24        "xor",25        # Relational operators26        "precedes",27        "follows",28        # String operators29        "like",30    ],31    "symbols": [32        # Bit operators33        ">>",34        "<<",35        # Logical operators36        # Numeric operators37        "+",38        "-",39        "/",40        "*",41        # Relational operators42        "<",43        "<=",44        ">",45        ">=",46        "=",47        "<>",48        # String operators49        "&",50    ],51}52 53# SCRIPT STATEMENTS54#   see https://help.qlik.com/en-US/sense/August2021/Subsystems/Hub/Content/Sense_Hub/Scripting/55STATEMENT_LIST = [56    # control statements57    "for",58    "each",59    "in",60    "next",61    "do",62    "while",63    "until",64    "unless",65    "loop",66    "return",67    "switch",68    "case",69    "default",70    "if",71    "else",72    "endif",73    "then",74    "end",75    "exit",76    "script",77    "switch",78    # prefixes79    "Add",80    "Buffer",81    "Concatenate",82    "Crosstable",83    "First",84    "Generic",85    "Hierarchy",86    "HierarchyBelongsTo",87    "Inner",88    "IntervalMatch",89    "Join",90    "Keep",91    "Left",92    "Mapping",93    "Merge",94    "NoConcatenate",95    "Outer",96    "Partial reload",97    "Replace",98    "Right",99    "Sample",100    "Semantic",101    "Unless",102    "When",103    # regular statements104    "Alias",  # alias ... as ...105    "as",106    "AutoNumber",107    "Binary",108    "Comment field",  # comment fields ... using ...109    "Comment fields",  # comment field ... with ...110    "using",111    "with",112    "Comment table",  # comment table ... with ...113    "Comment tables",  # comment tables ... using ...114    "Connect",115    "ODBC",  # ODBC CONNECT TO ...116    "OLEBD",  # OLEDB CONNECT TO ...117    "CUSTOM",  # CUSTOM CONNECT TO ...118    "LIB",  # LIB CONNECT TO ...119    "Declare",120    "Derive",121    "From",122    "explicit",123    "implicit",124    "Direct Query",125    "dimension",126    "measure",127    "Directory",128    "Disconnect",129    "Drop field",130    "Drop fields",131    "Drop table",132    "Drop tables",133    "Execute",134    "FlushLog",135    "Force",136    "capitalization",137    "case upper",138    "case lower",139    "case mixed",140    "Load",141    "distinct",142    "from",143    "inline",144    "resident",145    "from_field",146    "autogenerate",147    "extension",148    "where",149    "group by",150    "order by",151    "asc",152    "desc",153    "Let",154    "Loosen Table",155    "Map",156    "NullAsNull",157    "NullAsValue",158    "Qualify",159    "Rem",160    "Rename field",161    "Rename fields",162    "Rename table",163    "Rename tables",164    "Search",165    "include",166    "exclude",167    "Section",168    "access",169    "application",170    "Select",171    "Set",172    "Sleep",173    "SQL",174    "SQLColumns",175    "SQLTables",176    "SQLTypes",177    "Star",178    "Store",179    "Tag",180    "Trace",181    "Unmap",182    "Unqualify",183    "Untag",184    # Qualifiers185    "total",186]187 188# Script functions189#    see https://help.qlik.com/en-US/sense/August2021/Subsystems/Hub/Content/Sense_Hub/Scripting/functions-in-scripts-chart-expressions.htm190SCRIPT_FUNCTIONS = [191    # Basic aggregation functions in the data load script192    "FirstSortedValue",193    "Max",194    "Min",195    "Mode",196    "Only",197    "Sum",198    # Counter aggregation functions in the data load script199    "Count",200    "MissingCount",201    "NullCount",202    "NumericCount",203    "TextCount",204    # Financial aggregation functions in the data load script205    "IRR",206    "XIRR",207    "NPV",208    "XNPV",209    # Statistical aggregation functions in the data load script210    "Avg",211    "Correl",212    "Fractile",213    "FractileExc",214    "Kurtosis",215    "LINEST_B" "LINEST_df",216    "LINEST_f",217    "LINEST_m",218    "LINEST_r2",219    "LINEST_seb",220    "LINEST_sem",221    "LINEST_sey",222    "LINEST_ssreg",223    "Linest_ssresid",224    "Median",225    "Skew",226    "Stdev",227    "Sterr",228    "STEYX",229    # Statistical test functions230    "Chi2Test_chi2",231    "Chi2Test_df",232    "Chi2Test_p",233    # Two independent samples t-tests234    "ttest_conf",235    "ttest_df",236    "ttest_dif",237    "ttest_lower",238    "ttest_sig",239    "ttest_sterr",240    "ttest_t",241    "ttest_upper",242    # Two independent weighted samples t-tests243    "ttestw_conf",244    "ttestw_df",245    "ttestw_dif",246    "ttestw_lower",247    "ttestw_sig",248    "ttestw_sterr",249    "ttestw_t",250    "ttestw_upper",251    # One sample t-tests252    "ttest1_conf",253    "ttest1_df",254    "ttest1_dif",255    "ttest1_lower",256    "ttest1_sig",257    "ttest1_sterr",258    "ttest1_t",259    "ttest1_upper",260    # One weighted sample t-tests261    "ttest1w_conf",262    "ttest1w_df",263    "ttest1w_dif",264    "ttest1w_lower",265    "ttest1w_sig",266    "ttest1w_sterr",267    "ttest1w_t",268    "ttest1w_upper",269    # One column format functions270    "ztest_conf",271    "ztest_dif",272    "ztest_sig",273    "ztest_sterr",274    "ztest_z",275    "ztest_lower",276    "ztest_upper",277    # Weighted two-column format functions278    "ztestw_conf",279    "ztestw_dif",280    "ztestw_lower",281    "ztestw_sig",282    "ztestw_sterr",283    "ztestw_upper",284    "ztestw_z",285    # String aggregation functions in the data load script286    "Concat",287    "FirstValue",288    "LastValue",289    "MaxString",290    "MinString",291    # Synthetic dimension functions292    "ValueList",293    "ValueLoop",294    # Color functions295    "ARGB",296    "HSL",297    "RGB",298    "Color",299    "Colormix1",300    "Colormix2",301    "SysColor",302    "ColorMapHue",303    "ColorMapJet",304    "black",305    "blue",306    "brown",307    "cyan",308    "darkgray",309    "green",310    "lightblue",311    "lightcyan",312    "lightgray",313    "lightgreen",314    "lightmagenta",315    "lightred",316    "magenta",317    "red",318    "white",319    "yellow",320    # Conditional functions321    "alt",322    "class",323    "coalesce",324    "if",325    "match",326    "mixmatch",327    "pick",328    "wildmatch",329    # Counter functions330    "autonumber",331    "autonumberhash128",332    "autonumberhash256",333    "IterNo",334    "RecNo",335    "RowNo",336    # Integer expressions of time337    "second",338    "minute",339    "hour",340    "day",341    "week",342    "month",343    "year",344    "weekyear",345    "weekday",346    # Timestamp functions347    "now",348    "today",349    "LocalTime",350    # Make functions351    "makedate",352    "makeweekdate",353    "maketime",354    # Other date functions355    "AddMonths",356    "AddYears",357    "yeartodate",358    # Timezone functions359    "timezone",360    "GMT",361    "UTC",362    "daylightsaving",363    "converttolocaltime",364    # Set time functions365    "setdateyear",366    "setdateyearmonth",367    # In... functions368    "inyear",369    "inyeartodate",370    "inquarter",371    "inquartertodate",372    "inmonth",373    "inmonthtodate",374    "inmonths",375    "inmonthstodate",376    "inweek",377    "inweektodate",378    "inlunarweek",379    "inlunarweektodate",380    "inday",381    "indaytotime",382    # Start ... end functions383    "yearstart",384    "yearend",385    "yearname",386    "quarterstart",387    "quarterend",388    "quartername",389    "monthstart",390    "monthend",391    "monthname",392    "monthsstart",393    "monthsend",394    "monthsname",395    "weekstart",396    "weekend",397    "weekname",398    "lunarweekstart",399    "lunarweekend",400    "lunarweekname",401    "daystart",402    "dayend",403    "dayname",404    # Day numbering functions405    "age",406    "networkdays",407    "firstworkdate",408    "lastworkdate",409    "daynumberofyear",410    "daynumberofquarter",411    # Exponential and logarithmic412    "exp",413    "log",414    "log10",415    "pow",416    "sqr",417    "sqrt",418    # Count functions419    "GetAlternativeCount",420    "GetExcludedCount",421    "GetNotSelectedCount",422    "GetPossibleCount",423    "GetSelectedCount",424    # Field and selection functions425    "GetCurrentSelections",426    "GetFieldSelections",427    "GetObjectDimension",428    "GetObjectField",429    "GetObjectMeasure",430    # File functions431    "Attribute",432    "ConnectString",433    "FileBaseName",434    "FileDir",435    "FileExtension",436    "FileName",437    "FilePath",438    "FileSize",439    "FileTime",440    "GetFolderPath",441    "QvdCreateTime",442    "QvdFieldName",443    "QvdNoOfFields",444    "QvdNoOfRecords",445    "QvdTableName",446    # Financial functions447    "FV",448    "nPer",449    "Pmt",450    "PV",451    "Rate",452    # Formatting functions453    "ApplyCodepage",454    "Date",455    "Dual",456    "Interval",457    "Money",458    "Num",459    "Time",460    "Timestamp",461    # General numeric functions462    "bitcount",463    "div",464    "fabs",465    "fact",466    "frac",467    "sign",468    # Combination and permutation functions469    "combin",470    "permut",471    # Modulo functions472    "fmod",473    "mod",474    # Parity functions475    "even",476    "odd",477    # Rounding functions478    "ceil",479    "floor",480    "round",481    # Geospatial functions482    "GeoAggrGeometry",483    "GeoBoundingBox",484    "GeoCountVertex",485    "GeoInvProjectGeometry",486    "GeoProjectGeometry",487    "GeoReduceGeometry",488    "GeoGetBoundingBox",489    "GeoGetPolygonCenter",490    "GeoMakePoint",491    "GeoProject",492    # Interpretation functions493    "Date#",494    "Interval#",495    "Money#",496    "Num#",497    "Text",498    "Time#",499    "Timestamp#",500    # Field functions501    "FieldIndex",502    "FieldValue",503    "FieldValueCount",504    # Inter-record functions in the data load script505    "Exists",506    "LookUp",507    "Peek",508    "Previous",509    # Logical functions510    "IsNum",511    "IsText",512    # Mapping functions513    "ApplyMap",514    "MapSubstring",515    # Mathematical functions516    "e",517    "false",518    "pi",519    "rand",520    "true",521    # NULL functions522    "EmptyIsNull",523    "IsNull",524    "Null",525    # Basic range functions526    "RangeMax",527    "RangeMaxString",528    "RangeMin",529    "RangeMinString",530    "RangeMode",531    "RangeOnly",532    "RangeSum",533    # Counter range functions534    "RangeCount",535    "RangeMissingCount",536    "RangeNullCount",537    "RangeNumericCount",538    "RangeTextCount",539    # Statistical range functions540    "RangeAvg",541    "RangeCorrel",542    "RangeFractile",543    "RangeKurtosis",544    "RangeSkew",545    "RangeStdev",546    # Financial range functions547    "RangeIRR",548    "RangeNPV",549    "RangeXIRR",550    "RangeXNPV",551    # Statistical distribution552    "CHIDIST",553    "CHIINV",554    "NORMDIST",555    "NORMINV",556    "TDIST",557    "TINV",558    "FDIST",559    "FINV",560    # String functions561    "Capitalize",562    "Chr",563    "Evaluate",564    "FindOneOf",565    "Hash128",566    "Hash160",567    "Hash256",568    "Index",569    "KeepChar",570    "Left",571    "Len",572    "LevenshteinDist",573    "Lower",574    "LTrim",575    "Mid",576    "Ord",577    "PurgeChar",578    "Repeat",579    "Replace",580    "Right",581    "RTrim",582    "SubField",583    "SubStringCount",584    "TextBetween",585    "Trim",586    "Upper",587    # System functions588    "Author",589    "ClientPlatform",590    "ComputerName",591    "DocumentName",592    "DocumentPath",593    "DocumentTitle",594    "EngineVersion",595    "GetCollationLocale",596    "GetObjectField",597    "GetRegistryString",598    "IsPartialReload",599    "OSUser",600    "ProductVersion",601    "ReloadTime",602    "StateName",603    # Table functions604    "FieldName",605    "FieldNumber",606    "NoOfFields",607    "NoOfRows",608    "NoOfTables",609    "TableName",610    "TableNumber",611]612 613# System variables and constants614# see https://help.qlik.com/en-US/sense/August2021/Subsystems/Hub/Content/Sense_Hub/Scripting/work-with-variables-in-data-load-editor.htm615CONSTANT_LIST = [616    # System Variables617    "floppy",618    "cd",619    "include",620    "must_include",621    "hideprefix",622    "hidesuffix",623    "qvpath",624    "qvroot",625    "QvWorkPath",626    "QvWorkRoot",627    "StripComments",628    "Verbatim",629    "OpenUrlTimeout",630    "WinPath",631    "WinRoot",632    "CollationLocale",633    "CreateSearchIndexOnReload",634    # value handling variables635    "NullDisplay",636    "NullInterpret",637    "NullValue",638    "OtherSymbol",639    # Currency formatting640    "MoneyDecimalSep",641    "MoneyFormat",642    "MoneyThousandSep",643    # Number formatting644    "DecimalSep",645    "ThousandSep",646    "NumericalAbbreviation",647    # Time formatting648    "DateFormat",649    "TimeFormat",650    "TimestampFormat",651    "MonthNames",652    "LongMonthNames",653    "DayNames",654    "LongDayNames",655    "FirstWeekDay",656    "BrokenWeeks",657    "ReferenceDay",658    "FirstMonthOfYear",659    # Error variables660    "errormode",661    "scripterror",662    "scripterrorcount",663    "scripterrorlist",664    # Other665    "null",666]667 
codekingpro/portable-devtools · Team Ai