Qlik Dashboard

Build your own Modzy-powered analytics dashboard

:rocket: What's it do?

Qlik is a popular analytics dashboarding tool that allows users to easily load, combine, visualize, and explore their data, and with Modzy's APIs, users can include an AI-powered component with just a few clicks. This application leverages Modzy's accounting and jobs API services to build a custom analytics dashboard for administrators to monitor their organization's AI usage.

:fork-and-knife: Ingredients

  • A Qlik Account
  • Modzy's Jobs, Teams, and API Keys API services
  • A Modzy instance populated with several users, API keys, and inference jobs

:books: Instructions

The "Add Data" button will allow you to create your REST API connections to retrieve data from Modzy. Fill in the appropriate Modzy URL and method request based on the API Reference.

1861

Adding REST Connection to Dashboard

Preview your data and select only what you need

1379

Under the "Data model viewer tab," associate data manually or using the recommended associations.

1918

Parametrize your data load scripts.

Example "Get Jobs" SQL Script:

Set dataManagerTables = '','jobs','jobs.model','jobs.user','dates';
//This block renames script tables from non generated section which conflict with the names of managed tables

For each name in $(dataManagerTables) 
    Let index = 0;
    Let currentName = name; 
    Let tableNumber = TableNumber(name); 
    Let matches = 0; 
    Do while not IsNull(tableNumber) or (index > 0 and matches > 0)
        index = index + 1; 
        currentName = name & '-' & index; 
        tableNumber = TableNumber(currentName) 
        matches = Match('$(currentName)', $(dataManagerTables));
    Loop 
    If index > 0 then 
            Rename Table '$(name)' to '$(currentName)'; 
    EndIf; 
Next; 
Set dataManagerTables = ;


Unqualify *;

LIB CONNECT TO [Get jobs history];

[jobs]:
LOAD
    [jobIdentifier] AS [jobs.identifier],
    [submittedBy] AS [jobs.submittedBy],
    [accountIdentifier] AS [jobs.accountIdentifier],
    [status] AS [jobs.status],
    [createdAt] AS [jobs.createdAt],
    [updatedAt] AS [jobs.updatedAt],
    [submittedAt] AS [dates.date-submittedAt],
    [total] AS [jobs.totals],
    [pending] AS [jobs.pending],
    [completed] AS [jobs.completed],
    [failed] AS [jobs.failed],
    [elapsedTime] AS [jobs.elapsedTime],
    [queueTime] AS [jobs.queueTime],
    [explain] AS [jobs.explain],
    [__KEY_root] AS [jobs.PK],
    left([createdAt], 10) as [jobs.createdAtDate],
    if ([elapsedTime] - [queueTime] < 0, 0, [elapsedTime] - [queueTime]) as [jobs.processingTime]
WHERE total > 0;
SQL SELECT 
    "jobIdentifier",
    "submittedBy",
    "accountIdentifier",
    "status",
    "createdAt",
    "updatedAt",
    "submittedAt",
    "total",
    "pending",
    "completed",
    "failed",
    "elapsedTime",
    "queueTime",
    "explain",
    "__KEY_root"
FROM JSON (wrap on) "root" PK "__KEY_root" QDL
WITH CONNECTION ( 
    HTTPHEADER "authorization" "ApiKey $(ApiKey)",
    QUERY "startDate" "$(startDateTime)"
);

[jobs.model]:
LOAD
    [identifier] AS [jobs.model.identifier],
    [version] AS [jobs.model.version],
    [name] AS [jobs.model.name],
    [__FK_model] AS [jobs.model.FK.jobs],
    [name] & '-' & [version] AS [jobs.model.name-version];
SQL SELECT 
    (SELECT 
        "identifier",
        "version",
        "name",
        "__FK_model"
    FROM "model" FK "__FK_model")
FROM JSON (wrap on) "root" PK "__KEY_root" QDL
WITH CONNECTION ( 
    HTTPHEADER "authorization" "ApiKey $(ApiKey)",
    QUERY "startDate" "$(startDateTime)"
);

[jobs.user]:
LOAD
    [identifier] AS [jobs.user.identifier],
    [externalIdentifier] AS [jobs.user.externalIdentifier],
    [firstName] AS [jobs.user.firstName],
    [lastName] AS [jobs.user.lastName],
    [email] AS [jobs.user.email],
    [status] AS [jobs.user.status],
    [title] AS [jobs.user.title],
    [__KEY_user] AS [jobs.user.PK],
    [__FK_user] AS [jobs.user.FK.teams];
SQL SELECT 
    (SELECT 
        "identifier",
        "externalIdentifier",
        "firstName",
        "lastName",
        "email",
        "status",
        "title",
        "__KEY_user",
        "__FK_user"
    FROM "user" PK "__KEY_user" FK "__FK_user")
FROM JSON (wrap on) "root" PK "__KEY_root" QDL
WITH CONNECTION ( 
    HTTPHEADER "authorization" "ApiKey $(ApiKey)",
    QUERY "startDate" "$(startDateTime)"
);


[dates]:
LOAD
    Date([date], 'YYYY-MM-DD') as [dates.date],
    [day] AS [dates.day],
    [day_name] AS [dates.day_name],
    [month] AS [dates.month],
    [year] AS [dates.year],
    [dow] AS [dates.dow],
    [julian_date] AS [dates.julian_date],
    [date_full_name] AS [dates.date_full_name],
    [date_short_name] AS [dates.date_short_name],
    [day_short_name] AS [dates.day_short_name],
    [day_full_name] AS [dates.day_full_name],
    [month_short_name] AS [dates.month_short_name],
    [month_full_name] AS [dates.month_full_name],
    [quarter] AS [dates.quarter],
    [quarter_full_name] AS [dates.quarter_full_name],
    [quarter_short_name] AS [dates.quarter_short_name],
    [first_day_of_month] AS [dates.first_day_of_month],
    [last_day_of_month] AS [dates.last_day_of_month],
    [last_day_of_previous_month] AS [dates.last_day_of_previous_month],
    [week_of_month] AS [dates.week_of_month],
    [week_of_month_full_name] AS [dates.week_of_month_full_name],
    [week_of_month_short_name] AS [dates.week_of_month_short_name],
    [days_from_today] AS [dates.days_from_today],
    [working_day] AS [dates.working_day],
    [prev_date] AS [dates.prev_date],
    [prev_month_full_name] AS [dates.prev_month_full_name],
    [prev_month_short_name] AS [dates.prev_month_short_name],
    [prev_year] AS [dates.prev_year]
FROM [lib://DataFiles/rdDates.xls](biff, embedded labels, table is dates$)
WHERE ([year] = 2021);




[autoCalendar]: 
  DECLARE FIELD DEFINITION Tagged ('$date')
FIELDS
  Dual(Year($1), YearStart($1)) AS [Year] Tagged ('$axis', '$year'),
  Dual('Q'&Num(Ceil(Num(Month($1))/3)),Num(Ceil(NUM(Month($1))/3),00)) AS [Quarter] Tagged ('$quarter'),
  Dual(Year($1)&'-Q'&Num(Ceil(Num(Month($1))/3)),QuarterStart($1)) AS [YearQuarter] Tagged ('$axis', '$yearquarter'),
  Month($1) AS [Month] Tagged ('$month'),
  Dual(Year($1)&'-'&Month($1), monthstart($1)) AS [YearMonth] Tagged ('$axis', '$yearmonth'),
  Dual(W&Num(Week($1),00), Num(Week($1),00)) AS [Week] Tagged ('$weeknumber'),
  Date($1) AS [Date] Tagged ('$date');

Customize your dashboard based on your preferences or needs

1097

:cake: Final Dish

A comprehensive and AI-powered dashboard to help you keep track of your organization's Modzy usage.

1919

Modzy Powered Analytics Dashboard