Skip to main content

Welcome to
Qlik Community!

cancel
Showing results for 
Search instead for 
Did you mean: 
  • 211,671 members
  • 4,706 online
  • 1,985,535 posts
  • 148,630 Solutions
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE

Welcome to Qlik Community

Recent Discussions

  • forum

    Integration, Extension & APIs

    Rotate Qlik Replicate Endpoint Passwords

    Is there an API or CLI command for changing Relipcate Endpoint passwords?  Our organization requires password rotations and we are setting up many end... Show More

    Is there an API or CLI command for changing Relipcate Endpoint passwords?  Our organization requires password rotations and we are setting up many endpoints.  Having to manually touch every endpoint in the GUI to update the passwords would be painful.  Ideally there would be some type of command line utility we could script to update the endpoints when the passwords are rotated in the databases.

    Show Less
  • forum

    Qlik Replicate

    Qlik Upgrade from Nov 2022 to May 2023

    Hi Team, We are upgrading Qlik replicate and Qlik Enterprise manager .   So at the time of upgrade we are stopping all jobs and upgrading. once done w... Show More

    Hi Team,

    We are upgrading Qlik replicate and Qlik Enterprise manager .

     

    So at the time of upgrade we are stopping all jobs and upgrading. once done we are restarting

     

    Doubt

    1.After the Upgrade is done do we need to restart the Qlik server or not to make sure the jobs are running 

    2.After the Upgrade we can resume processing for all the jobs that we stopped before upgrade or do we need to reload the target for all the jobs.

     

    Most of the jobs uses Microsoft SQL server end point type.

     

    Please let us know the above scenarios in details and let u know any feedback

     

    Thanks 

    N L N Vivek

    Show Less
  • forum

    Qlik Application Automation

    Store Master Items in a QVD

    We have a singular data model that we reuse in many of our apps, about 97% of them. Master Items are great to allow our non-technical users to create ... Show More

    We have a singular data model that we reuse in many of our apps, about 97% of them. Master Items are great to allow our non-technical users to create with more ease, but having to rebuild master items from app to app is cumbersome. 

    Is there a way to store these master items in a QVD so in a new app I can just paste the scrip for our data model followed by the load script for the master items QVD?

    If this is not possible are there any extensions/external solutions to this?

    Show Less
  • forum

    Integration, Extension & APIs

    How to embed Qlik App/Sheet on the website

    I want to embed Qlik app/sheet on my website. There are apps on the Qlik, and the apps contains the sheets, which I want to embed for showing to websi... Show More

    I want to embed Qlik app/sheet on my website. There are apps on the Qlik, and the apps contains the sheets, which I want to embed for showing to website visitors/user. But users don't have access of Qlik, so I need to embed with some kind of authentication by code.

    Before going on the code, I have following things created on the Qlik Management Console (QMC):

    1. Tenant host
    2. Added my domain in the Content Security Policy section and selected frame-ancestors in the Directive
    3. Web Integration Id created in Web Integration Configuration section
    4. Client Id and secret created in OAuth section
    5. Public key, Private key created by following this article: Create Signed Tokens for JWT Authorization
    6. After following above article, I also have Issuer, Key ID which I setup in the Identity Provider section

    Following is my usecase

    User first select an app from the dropdown, this list populated through the following API:

    GET https://QLIK-TENANT/api/v1/items?resourceType=app
    Header: Bearer <token generated with OAuth Client id and secret>
    

    And it is working.

    After that I need to show another dropdown for all the sheets of the selected app. But I am unable to fetch the list of sheets. I checked there is no REST API which can give me sheets by an app.

    Question 1: How can I get sheet list of the app? I also plan to list the sheets using below JS code, but that is also not working.

    Once user select app and sheet, then click on a button to Render sheet, and it should render that sheet on the webpage.

    I tried using below piece of code (enigma js), referenced from here: Handle sheets in iframes with enigma.js

    <html>
    <head>
    <script src="https://unpkg.com/enigma.js/enigma.min.js"></script>
    </head>
    <body>
        <div id="main">
            <div id="message"></div>
            <iframe id="qlik_frame" style="border:none;width:100%;height:900px;"></iframe>
        </div>
        <script type="text/javascript">
            // CONFIGURATION
            const TENANT = "xxxxxxxxxxxxx.xx.qlikcloud.com";
            const JWTENDPOINT = "https://example.com/api/v1/qlik/jwtToken"; // this endpoint create a JWT token using passed data and the private key mentioned in point #6 above
            const WEBINTEGRATIONID = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; // mentioned in point #3 above
            const APPID = "411111e0-36f8-4e6d-b25d-f0xxxxxxxxca"; // got using the REST API mentioned above
            const IDENTITY = "xxxxxxxxxxxxxx"; // An arbitrary string to establish a separate session state.
    
            // MAIN
            (async function main() {
                const isLoggedIn = await qlikLogin();
                const qcsHeaders = await getQCSHeaders();
                const [session, enigmaApp] = await connectEnigma(qcsHeaders, APPID, IDENTITY);
    
                handleDisconnect(session);
                const theme = await getTheme(enigmaApp);
                const spaceId = (await getApp(APPID)).spaceId;
                const spaceType = await getSpaceType(spaceId);
                const sheets = await getSheetList(enigmaApp, spaceType);
    
                renderSingleIframe("qlik_frame", APPID, sheets[0].qInfo.qId, theme, IDENTITY);
            })();
    
            // LOGIN
            async function qlikLogin() {
                const loggedIn = await checkLoggedIn();
                if (loggedIn.status !== 200) {
                    const $jwtPostData = {
                        kid: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", // mentioned in point #6 above
                        iss: "xxxxxxxxxxxxx.xx.qlikcloud.com", 
                        name: "?????????" // what it should be????
                    };
                    const tokenRes = await (await getJWTToken(JWTENDPOINT, $jwtPostData));
                    const loginRes = await jwtLogin(tokenRes.body);
    
                    if (loginRes.status != 200) {
                        const message = "Something went wrong while logging in.";
                        throw new Error(message);
                    }
                    const recheckLoggedIn = await checkLoggedIn();
                    if (recheckLoggedIn.status !== 200) {
                        const message = "Third-party cookies are not enabled in your browser settings and/or browser mode.";
                        throw new Error(message);
                    }
                }
                return true;
            }
    
            async function checkLoggedIn() {
                return await fetch(`https://${TENANT}/api/v1/users/me`, {
                    mode: "cors",
                    credentials: "include",
                    headers: {
                        "qlik-web-integration-id": WEBINTEGRATIONID
                    },
                })
            }
    
            // Get Method the JWT and use it to obtain Qlik Cloud session cookie.
            async function getJWTToken(jwtEndpoint, payloadData) {
                try {
                    // Define the headers for the request, including the content type
                    const headers = new Headers({
                        "Content-Type": "application/json",
                    });
    
                    // Create a request object with the specified method, headers, and body
                    const requestOptions = {
                        method: "POST",
                        headers: headers,
                        mode: "cors",
                        body: JSON.stringify(payloadData), // Convert payloadData to JSON
                    };
    
                    // Use the fetch function to make a POST request to the specified endpoint
                    const response = await fetch(jwtEndpoint, requestOptions);
    
                    // Check if the response status code indicates success (e.g., 200 OK)
                    if (response.ok) {
                        // Parse the response body as JSON, assuming it contains the JWT
                        const jwtData = await response.json();
                        return jwtData; // Return the JWT data
                    } else {
                        // Handle HTTP error responses here if needed
                        throw new Error(`HTTP error! Status: ${response.status}`);
                    }
                } catch (error) {
                    // Handle any exceptions that may occur during the fetch request
                    console.error("Error fetching JWT:", error);
                    throw error;
                }
            }
    
            async function jwtLogin(token) {
                const authHeader = `Bearer ${token}`;
                return await fetch(`https://${TENANT}/login/jwt-session?qlik-web-integration-id=${WEBINTEGRATIONID}`, {
                    credentials: "include",
                    mode: "cors",
                    method: "POST",
                    headers: {
                        "Authorization": authHeader,
                        "qlik-web-integration-id": WEBINTEGRATIONID
                    },
                })
            }
    
            async function getQCSHeaders() {
                const response = await fetch(`https://${TENANT}/api/v1/csrf-token`, {
                    mode: "cors",
                    credentials: "include",
                    headers: {
                        "qlik-web-integration-id": WEBINTEGRATIONID
                    },
                })
    
                const csrfToken = new Map(response.headers).get("qlik-csrf-token");
                return {
                    "qlik-web-integration-id": WEBINTEGRATIONID,
                    "qlik-csrf-token": csrfToken,
                };
            }
    
            // ENIGMA ENGINE CONNECTION
            async function connectEnigma(qcsHeaders, appId, identity) {
                const [session, app] = await getEnigmaSessionAndApp(appId, qcsHeaders, identity);
                return [session, app];
            }
    
            async function getEnigmaSessionAndApp(appId, headers, identity) {
                const params = Object.keys(headers)
                    .map((key) => `${key}=${headers[key]}`)
                    .join("&");
    
                return (async () => {
                    const schema = await (await fetch("https://unpkg.com/enigma.js@2.7.0/schemas/12.612.0.json")).json();
    
                    try {
                        return await createEnigmaAppSession(schema, appId, identity, params);
                    } catch {
                        // If the socket is closed immediately following the connection this
                        // could be due to an edge-case race condition where the newly created
                        // user does not yet have access to the app due to access control propagation.
                        // This bit of code will make another attempt after a 1.5 seconds.
                        const waitSecond = await new Promise(resolve => setTimeout(resolve, 1500));
                        try {
                            return await createEnigmaAppSession(schema, appId, identity, params);
                        } catch (e) {
                            throw new Error(e);
                        }
                    }
                })();
            }
    
            async function createEnigmaAppSession(schema, appId, identity, params) {
                const session = enigma.create({
                    schema,
                    url: `wss://${TENANT}/app/${appId}/identity/${identity}?${params}`,
                    createSocket: url => new WebSocket(`wss://${TENANT}/app/${appId}/identity/${identity}?${params}`),
                });
    
                const enigmaGlobal = await session.open();
                const enigmaApp = await enigmaGlobal.openDoc(appId);
                return [session, enigmaApp];
            }
    
            // HANDLE ENGINE SESSION CLOSURE
            function handleDisconnect(session) {
                session.on("closed", () => {
                    console.log("Due to inactivity or loss of connection, this session has ended.");
                });
    
                session.on("suspended", () => {
                    console.log("Due to loss of connection, this session has been suspended.");
                });
    
                window.addEventListener("offline", () => {
                    session.close();
                });
            }
    
            // GET QLIK APP (FOR SPACE ID)
            async function getApp(appId) {
                var url = new URL(`https://${TENANT}/api/v1/items?resourceType=app&resourceId=${appId}`);
                const response = await fetch(url, {
                    method: "GET",
                    mode: "cors",
                    credentials: "include",
                    headers: {
                        "Content-Type": "application/json",
                        "qlik-web-integration-id": WEBINTEGRATIONID,
                    },
                })
                responseJson = await response.json();
                return responseJson.data[0];
            }
    
            // GET SPACE (FOR SPACE TYPE)
            async function getSpaceType(spaceId) {
                var url = new URL(`https://${TENANT}/api/v1/spaces/${spaceId}`);
                const response = await fetch(url, {
                    method: "GET",
                    mode: "cors",
                    credentials: "include",
                    headers: {
                        "Content-Type": "application/json",
                        "qlik-web-integration-id": WEBINTEGRATIONID,
                    },
                })
                responseJson = await response.json();
                return responseJson.type;
            }
    
            // GET THEME
            async function getTheme(enigmaApp) {
                const createAppProps = await enigmaApp.createSessionObject({
                    qInfo: {
                        qId: "AppPropsList",
                        qType: "AppPropsList"
                    },
                    qAppObjectListDef: {
                        qType: "appprops",
                        qData: {
                            theme: "/theme"
                        }
                    }
                });
                const appProps = await enigmaApp.getObject("AppPropsList");
                const appPropsLayout = await appProps.getLayout();
                const theme = appPropsLayout.qAppObjectList.qItems[0].qData.theme;
                return theme;
            }
    
            // GET SHEETS (WITH TYPE ADDED, E.G., BASE, COMMUNITY, PRIVATE)
            async function getSheetList(app, spaceType) {
                var sheets = await app.getObjects({
                    "qOptions": {
                        "qTypes": [
                            "sheet"
                        ],
                        "qIncludeSessionObjects": false,
                        "qData": {}
                    }
                })
                sheetsIncludingType = [];
                for await (const sheet of sheets) {
                    var pushSheet = true;
                    const sheetObject = await app.getObject(sheet.qInfo.qId);
                    const sheetLayout = await sheetObject.getLayout();
                    var isManaged = spaceType === "managed";
                    var sheetTypeEnum = 1;
                    var approved = sheet.qMeta.approved;
                    var published = sheet.qMeta.published;
                    const sheetTypeEnums = {
                        1: "Base",
                        2: "Community",
                        3: "Private"
                    };
                    if (!approved && !published) {
                        sheetTypeEnum = 3;
                    } else if (!approved && published) {
                        if (isManaged) {
                            sheetTypeEnum = 2;
                        }
                    }
                    const sheetTypeObject = {
                        "sheetType": sheetTypeEnums[sheetTypeEnum],
                        "sheetTypeEnum": sheetTypeEnum
                    };
                    const mergedObject = {
                        ...sheetLayout,
                        ...sheetTypeObject
                    };
                    sheetsIncludingType.push(mergedObject)
                }
                sheetsIncludingType.sort((a, b) => (a.sheetTypeEnum - b.sheetTypeEnum || a.rank - b.rank))
                return sheetsIncludingType;
            }
    
            // HELPER FUNCTION TO GENERATE IFRAME
            function renderSingleIframe(frameId, appId, sheetId, theme, identity) {
                const frameUrl = `https://${TENANT}/single/?appid=${appId}&sheet=${sheetId}&theme=${theme}&identity=${identity}&opt=ctxmenu,currsel`;
                document.getElementById(frameId).setAttribute("src", frameUrl);
            }
        </script>
    </body>
    </html>

    But when I tried to run, it is not working and returned following JS error in console, related to Socket:

    console.log.png

     

    Following is the network logs when I tried to run this code:

    network.log.png

    Question 2: How to embed sheet/app? In above code, Am I doing something wrong? Or if there are any other way to embed, please suggest me. Because I doubt, that it will need to create a lot of resources on the QMC. So there should be some API, to authenticate user, get token and use token to get embed code for the sheet.

    Please help me. Any suggestion will also be helpful.

    Thank you

    Show Less
  • forum

    New to Qlik Sense

    Adding new column with value Y and N based on value exist in another column

    Hello, I have a "Deposit Id" column with either deposit ID exist or not. Now I want to add an additional column which checks if deposit ID exist then ... Show More

    Hello,

    I have a "Deposit Id" column with either deposit ID exist or not. Now I want to add an additional column which checks if deposit ID exist then placeY and if not then place N.

    I tried many expressions in the Load statement but either I am getting Y or N but not both

    [DEPOSIT]:

    LOAD
    [DEPOSIT_ID],

    If([DEPOSIT_ID]>=1,'Yes','No') AS [DepositReceived]
    // if(([DEPOSIT_ID])= '-','N','Y')AS [DepositReceived]
    // If(Exists([DEPOSIT_ID]), 'Y', 'N') AS [DepositReceived]

    // IF(Not IsNull([DEPOSIT_ID]), 'Yes', 'No') AS [DepositReceived]

    FROM [/DEPOSIT.qvd]
    (qvd);

    I also tried the resident load statement but that also does not give me both Y and N values. 

    [temp]:

    Load
    *,
    If(Exists([DEPOSIT_ID]>=1), 'Y', 'N') AS [DepositReceived]

    Resident [DEPOSIT];
    DROP TABLE [DEPOSIT];

    Please let me know how  I can achieve both Yes and No values based on if Deposit ID exists or not. 

    Deposit ID is an alphanumeric characters something like 1-2AB6C45

    Many thanks!

    Show Less
  • forum

    App Development

    Automatic QVF export in Qlik Sense Enterprise

    Is there a way to save the application to a QVF file everytime it is reloaded, either through a task or load script? I am trying to sync the apps to a... Show More

    Is there a way to save the application to a QVF file everytime it is reloaded, either through a task or load script? I am trying to sync the apps to a Qlik Cloud tenant through DataTransfer

    Show Less
  • forum

    Move to SaaS

    User Adoption

    We are looking to track user adoption and ensure our rollout of Qlik Cloud is effective. Is there an app, monitoring app maybe, that you can view that... Show More

    We are looking to track user adoption and ensure our rollout of Qlik Cloud is effective. Is there an app, monitoring app maybe, that you can view that shows when people have logged into Qlik Cloud for the first time and/or viewed an app for the first time?

    Show Less
  • forum

    Integration, Extension & APIs

    Passing Multiple Roles via the User API (Okta Integration)

    Does the users API support sending multiple roles on a user create post call? The documentation only shows an example with one name in assignedRoles. ... Show More

    Does the users API support sending multiple roles on a user create post call? The documentation only shows an example with one name in assignedRoles.  

    Show Less
  • forum

    Qlik Cloud Data Integration

    Accumulation freezing on today's date for prior year

    For some reason when looking at an accumulation for current YTD and all of prior year (not prior YTD) the accumulation for last year stops at today fo... Show More

    For some reason when looking at an accumulation for current YTD and all of prior year (not prior YTD) the accumulation for last year stops at today for prior EOY. see table below:

    bskemp01_0-1708700481380.png

     

    here is the expressions in my table:

    Date - Dimension:

    Date(MakeDate(Year(Today())-1,Month,DayNumber), 'MMM-D')

     

    REV YTD: 

    {$<
      Year={'$(=max([Year]))'},
      [DateType]={'Invoiced'}
    >}
    // 0 = USE, 1 = CAD
    if(Currency_Code=0,     
          Sum([Company 1 Sales])
          +
          Sum((1/[Rate])*[Company 2 Sales CAD])
          +
          Sum([Company 3 Sales])
          +
          Sum((1/[Rate])*[Company 4 Sales CAD])
    ,
          Sum(Rate*[Company 1 Sales])
          +
          Sum([Company 2 Sales CAD])
          +
          Sum(Rate*[Company 3 Sales])
          +
          Sum([Company 4 Sales CAD])
    )

     

    EOY PY: 

    {<
      Year={'$(=max([Year])-1)'},
      [DateType]={'Invoiced'}
    >}
    
    if(Currency_Code=0,
      Sum([Company 1 Sales])
          +
          Sum((1/[Rate])*[Company 2 Sales CAD])
          +
          Sum([Company 3 Sales])
          +
          Sum((1/[Rate])*[Company 4 Sales CAD])
    ,
          Sum(Rate*[Company 1 Sales])
          +
          Sum([Company 2 Sales CAD])
          +
          Sum(Rate*[Company 3 Sales])
          +
          Sum([Company 4 Sales CAD])
    )
    

     

    also i do have the Year field as a required field:

    bskemp01_1-1708700795637.png

     

    Show Less
  • forum

    QlikView App Dev

    Qlik View

    How can I remove the headers in pivot table in Qlik View??
Leaderboard

Customer Story

Qlik Data Integration & Qlik Replicate story

Qlik enables a frictionless migration to AWS cloud by Empresas SB, a group of Chilean health and beauty retail companies employing 10,000 people with 600 points of sale.

Customer Story

Building a Collaborative Analytics Space

Qlik Luminary Stephanie Robinson of JBS USA, the US arm of the global food company employing 70,000 in the US, and over 270,000 people worldwide.

Location and Language Groups

Choose a Group

Join one of our Location and Language groups. Find one that suits you today!

Collaborate

Healthcare User Group

Healthcare User Group

A private group is for healthcare organizations, partners, and Qlik healthcare staff to collaborate and share insights..

All are welcome

Japan Group

Japan

Qlik Communityの日本語のグループです。 Qlik製品に関する日本語資料のダウンロードや質問を日本語で投稿することができます。

Request to join

Brasil Group

Brazil

Welcome to the group for Brazil users. .All discussions will be in Portuguese.

open to all

Blogs

Community News

Hear from your Community team as they tell you about updates to the Qlik Community Platform and more!