///$tab About /*********************************************************** This is a sample script that demonstrates how you might load QSDA Pro exported Analysis files to create a datamodel. This script is provided as an "as-is" sample. This file is part of QSDA Pro https://easyqlik.com/qsda ***********************************************************/ Set Version = 2.5; ///$tab Main SET ThousandSep=','; SET DecimalSep='.'; SET MoneyThousandSep=','; SET MoneyDecimalSep='.'; SET MoneyFormat='$#,##0.00;-$#,##0.00'; SET TimeFormat='h:mm:ss TT'; SET DateFormat='M/D/YYYY'; SET TimestampFormat='M/D/YYYY h:mm:ss[.fff] TT'; SET FirstWeekDay=6; SET BrokenWeeks=1; SET ReferenceDay=0; SET FirstMonthOfYear=1; SET CollationLocale='en-US'; SET CreateSearchIndexOnReload=1; SET MonthNames='Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sep;Oct;Nov;Dec'; SET LongMonthNames='January;February;March;April;May;June;July;August;September;October;November;December'; SET DayNames='Mon;Tue;Wed;Thu;Fri;Sat;Sun'; SET LongDayNames='Monday;Tuesday;Wednesday;Thursday;Friday;Saturday;Sunday'; SET NumericalAbbreviation='3:k;6:M;9:G;12:T;15:P;18:E;21:Z;24:Y;-3:m;-6:μ;-9:n;-12:p;-15:f;-18:a;-21:z;-24:y'; ///$tab Setup // The name of connection for your unzipped export files. Set vExportConnection = Qsda-Export; // Provide the subdirectory for the unzipped export. Set vExportSubDir = QSDA-DA Sample App(1)-ba6b1472-bab4-411f-a0c9-e5811234b160; ///$tab Qualify // Common fields we don't want to automatically link Qualify *; Unqualify "Key_*"; ///$tab Appinfo Appinfo: LOAD QsdaVersion, // MetaId, AppId, Name, Title, "FileSize", LastReloadTime, StateNames, HasSectionAccess, Published, PublishTime FROM [lib://$(vExportConnection)/$(vExportSubDir)/Appinfo.csv] (txt, codepage is 28591, embedded labels, delimiter is ',', msq); ///$tab Bookmarks Bookmarks: LOAD QsdaVersion, MetaId as Key_Bookmark, Id, Title, SelectionFields, CreationDate, Published, Approved, OwnerName FROM [lib://$(vExportConnection)/$(vExportSubDir)/Bookmarks.csv] (txt, codepage is 28591, embedded labels, delimiter is ',', msq); ///$tab Dimensions Dimensions: LOAD QsdaVersion, MetaId as Key_Dimension, LibraryId, ObjectId, IsMasterDimension, Label, Grouping, Def, "Fieldname", CheckResult, Description, DimensionType, HasDuplicateLabel, HasDuplicateDef, HasDuplicate, IsUsed, UseCount, PropertyPath, PropertyLocation FROM [lib://$(vExportConnection)/$(vExportSubDir)/Dimensions.csv] (txt, codepage is 28591, embedded labels, delimiter is ',', msq); ///$tab Errors IF FileSize('lib://$(vExportConnection)/$(vExportSubDir)/Errors.csv') > 0 THEN // Errors will be empty if no errors Errors: LOAD QsdaVersion, ErrorObjectName, ErrorMessage FROM [lib://$(vExportConnection)/$(vExportSubDir)/Errors.csv] (txt, utf8, no labels, delimiter is '\t', msq); ENDIF ///$tab Expressions Expressions: LOAD QsdaVersion, MetaId as Key_Expression, ObjectId, LibraryId, IsMasterMeasure, Label, Def, DefExpanded, MatchingMeasure, PropertyLocation, PropertyPath, SheetId, UseCount, Description, CheckResult, FieldNames, MeasureNames, VariableNames, FunctionNames, NonSetTableCount, Error, Hash FROM [lib://$(vExportConnection)/$(vExportSubDir)/Expressions.csv] (txt, codepage is 28591, embedded labels, delimiter is ',', msq); ///$tab Fields Fields: LOAD QsdaVersion, MetaId as Key_Field, Name, Cardinal, TotalBytes, ByteSize, SymbolWidth, IndexBytes, PointerBits, UseCount, KeyCount, IsUsed, IsHidden, IsSystem, IsIslandTable, AlwaysOneSelected, IsDefinitionOnly, IsNumeric, "Tags", "Comment", NumFormatFmt, NumFormatType FROM [lib://$(vExportConnection)/$(vExportSubDir)/Fields.csv] (txt, codepage is 28591, embedded labels, delimiter is ',', msq); ///$tab Flags Flags: LOAD QsdaVersion, MetaId as Key_Flag, Flag, Category, Label, Description, Impact, RefObjectType, RefMetaId FROM [lib://$(vExportConnection)/$(vExportSubDir)/Flags.csv] (txt, codepage is 28591, embedded labels, delimiter is ',', msq); ///$tab SheetObjects SheetObjects: LOAD QsdaVersion, SheetId, ObjectId, IsMissingObject FROM [lib://$(vExportConnection)/$(vExportSubDir)/SheetObjects.csv] (txt, codepage is 28591, embedded labels, delimiter is ',', msq); ///$tab Sheets Sheets: LOAD QsdaVersion, MetaId as Key_Sheet, Id, Name, Description, Rank, Published, Approved, OwnerName FROM [lib://$(vExportConnection)/$(vExportSubDir)/Sheets.csv] (txt, codepage is 28591, embedded labels, delimiter is ',', msq); ///$tab TableFields TableFields: LOAD QsdaVersion, MetaId as Key_TableField, "TableName", "FieldName", KeyType, SubsetRatio, InformationDensity, HasDuplicates, HasNull, IsSynthetic, NonNulls, PresentDistinctValues, TotalDistinctValues, Cardinality FROM [lib://$(vExportConnection)/$(vExportSubDir)/TableFields.csv] (txt, codepage is 28591, embedded labels, delimiter is ',', msq); ///$tab Tables Tables: LOAD QsdaVersion, MetaId as Key_Table, Name, "NoOfRows", "NoOfFields", KeyCount, NonKeyUseCount, IsIsland, IsDirectDiscovery, "Comment", IsSynthetic, IsLoose, RowPointerBits, TotalBytes FROM [lib://$(vExportConnection)/$(vExportSubDir)/Tables.csv] (txt, codepage is 28591, embedded labels, delimiter is ',', msq); ///$tab Variables Variables: LOAD QsdaVersion, MetaId as Key_Variable, Name, Def, DefExpanded, CheckResult, IsScriptCreated, FieldNames, MeasureNames, VariableNames, FunctionNames, IsUsed, UseCount FROM [lib://$(vExportConnection)/$(vExportSubDir)/Variables.csv] (txt, codepage is 28591, embedded labels, delimiter is ',', msq); ///$tab Vizobjects Vizobjects: LOAD QsdaVersion, MetaId as Key_Vizobject, Id, "Type", Title, LibraryId, VizClass, IsExtensionMissing, IsMasterVisualization, Name, SheetName, SheetId, CalcTime, BookmarkApplied, CalcConditionUnfulfilled, NumOfColumns, NumOfRows, UseCount FROM [lib://$(vExportConnection)/$(vExportSubDir)/Vizobjects.csv] (txt, codepage is 28591, embedded labels, delimiter is ',', msq); ///$tab Linktable set NullInterpret =''; Linktable: LOAD Distinct 1 as InLinktable, Key_Bookmark, Key_Calctime, Key_Dimension, Key_Expression, Key_Field, Key_Flag, Key_Sheet, Key_Table, Key_TableField, Key_Vizobject, Key_Variable FROM [lib://$(vExportConnection)/$(vExportSubDir)/Linktable.csv] (txt, codepage is 28592, embedded labels, delimiter is ',', msq);