public void SaveMeasure(string AppId, string title, string description, List <string> tags, string definition) { var appIdentifier = location.AppWithIdOrDefault(AppId); var measure = new NxLibraryMeasureDef() { Def = definition, Label = title }; var properties = new Qlik.Sense.Client.MeasureProperties() { Title = title, Description = description, Tags = tags, Info = new NxInfo() { Type = "GenericMeasure" }, Measure = measure }; using (IApp app = location.App(appIdentifier)) { app.CreateMeasure(null, properties); } }
// Open a Qlik Sense app with the properties defined in this class public void QSOpenApp() { QSAppIsOpen = false; try { CheckConnection(); IAppIdentifier MyAppId; if (qsAppId != "" && qsAppId != null) { MyAppId = qsLocation.AppWithIdOrDefault(qsAppId); } else { MyAppId = qsLocation.AppWithNameOrDefault(qsAppName); } qsAppId = MyAppId.AppId; qsAppName = MyAppId.AppName; qsApp = qsLocation.App(MyAppId); qsAppThumbnailUrl = qsApp.GetAppProperties().Thumbnail.Url; // Later //QSReadFields(); QSReadMasterItems(); QSReadSheets(); //QSReadStories(); //GetAlternativeApps(qsAlternativeStreams); // Refresh the alternatives every time I open an app QSAppIsOpen = true; Console.WriteLine("QSEasy opened App " + (qsAppId != "" ? qsAppId : qsAppName) + " with handle: " + qsApp.Handle); } catch (Exception e) { Console.WriteLine(e.ToString()); QSAppIsOpen = false; } }