QlikView – Architecture

QlikView – Architecture ”; Previous Next As a leading Business Discovery Platform, QlikView is built with a very different approach to data discovery than other traditional platforms. QlikView does not first build a query and then fetch the result based on the query. Rather, it forms associations between different data objects as soon as it is loaded and prompts the user to explore the data in any way. There is no predefined data drill down paths. The data drill down paths can happen in any direction as long as the data is available and associated. Of course, a user can also play a role in creating the associations between data elements using data modeling approach available in QlikView. Architectural Overview QlikView”s architecture consists of a front end to visualize the processed data and a back end to provide the security and publication mechanism for QlikView user documents. The diagram given below depicts the internal working of QlikView. The architecture is discussed in detail below the picture. Front End The Front end in QlikView is a browser-based access point for viewing the QlikView documents. It contains the QlikView Server, which is mainly used by the Business users to access the already created BI reports through an internet or intranet URL. Business users explore and interact with data using this front end and derive conclusions about the data. They also collaborate with other users on a given set of reports by sharing insights and exploring data together, in real time or off-line. These user documents are in the format .qvw, which can also be stored in the windows OS as a standalone document The QlikView server in the front end manages the client server communication between the user and QlikView backend system. Back End The QlikView backend consists of QlikView desktop and QlikView publisher. The QlikView desktop is a wizard-driven Windows environment, which has the features to load and transform data from its source. Its drag and drop feature is used to create the GUI layout of the reports that becomes visible in the frontend. The file types, which are created by QlikView desktop are stored with an extension of .qvw. These are the files that are passed on to the QlikView server in the front end, which serves the users with these files. Also .qvw files can be modified to store the data-inly files, which are known as .qvd files. They are binary files, which contain only the data and not the GUI components. The QlikView publisher is used as distribution service to distribute the .qvw documents among various QlikView servers and users. It handles the authorization and access privileges. It also does the direct loading of data from data sources by using the connection strings defined in the .qvw files. Print Page Previous Next Advertisements ”;

QlikView – Aggregate Functions

QlikView – Aggregate Functions ”; Previous Next QlikView Aggregate functions are used to produce aggregate data from the rows of the table. The functions are applied to the columns when creating the load script. Given below is a sample list of Aggregate functions. We also need to apply the Group by clause appropriately when applying the aggregate functions. SUM gives the sum of the numeric values of the column. AVG gives the average of the numeric values of the column. MAX gives the maximum of the numeric values of the column. MIN gives the minimum of the numeric values of the column. Example Consider the following data stored as product_sales.csv in the local system. It represents the sales figures for different product lines and product category in a store. Product_Line,Product_category,Quantity,Value Sporting Goods,Outdoor Recreation,12,5642 Food, Beverages & Tobacco,38,2514 Apparel & Accessories,Clothing,54,2365 Apparel & Accessories,Costumes & Accessories,29,4487 Sporting Goods,Athletics,11,812 Health & Beauty,Personal Care,21,6912 Arts & Entertainment,Hobbies & Creative Arts,58,5201 Arts & Entertainment,Paintings,73,8451 Arts & Entertainment,Musical Instruments,41,1245 Hardware,Tool Accessories,2,456 Home & Garden,Bathroom Accessories,36,241 Food,Drinks,54,1247 Home & Garden,Lawn & Garden,29,5462 Office Supplies,Presentation Supplies,22,577 Hardware,Blocks,53,548 Baby & Toddler,Diapering,19,1247 Creating the Load Script We open the script editor in a new QlikView document using Control+E. The following code creates the required tables as inline data. After creating this script press control+R to reload the data into the QlikView document. Creating Sheet Object Let us create a Table Box sheet object to show the data generated by the Aggregate function. Go to the menu Layout → New Sheet Object → Table Box. The following window appears in which we mention the Title of the table and the select the required fields to be displayed. Clicking OK displays the data from the CSV file in the QlikView Table Box as shown below. Applying SUM() function Given below is the load script to find the sum of the sales quantity and sales value across the Product Lines and product categories. Click OK and press Control+R to reload the data into QlikView document. Now follow the same steps as given above in − Creating Sheet Objects to create a QlikView Table Box for displaying the result of the script as shown below. Applying AVG() function Given below is the load script to create the average of the sales quantity and sales value across each Product Line. # Average sales of Quantity and value in each Product Line. LOAD Product_Line, avg(Quantity), avg(Value) FROM [E:Qlikviewdataproduct_sales.csv] (txt, codepage is 1252, embedded labels, delimiter is ”,”, msq) Group by Product_Line; Click OK and press Control+R to reload the data into QlikView document. Now follow the same steps as given above in − Creating Sheet Objects to create a QlikView Table Box for displaying the result of the script as shown below. Applying MAX() & MIN() function Given below is the load script to create the maximum and minimum of the sales quantity across each Product Line. # Maximum and Minimum sales in each product Line. LOAD Product_Line, max(Quantity) as MaxQuantity, min(Quantity) as MinQuantity FROM [E:Qlikviewdataproduct_sales.csv] (txt, codepage is 1252, embedded labels, delimiter is ”,”, msq) Group by Product_Line; Click OK and Control+R to reload the data into QlikView document. Now follow the same steps as above in − Creating Sheet Objects to create a QlikView Table Box for displaying the result of the script as shown below. Print Page Previous Next Advertisements ”;

QlikView – Navigation

QlikView – Navigation ”; Previous Next In this chapter, we will get acquainted with the screens available to a user for doing various operations. We will learn the basic navigation and know the different functions performed by the icons available in QlikView. Getting Started Screen This screen is a gentle introduction to navigate around QlikView. This screen comes up when you start QlikView and keep the Show start page when launching QlikView option checked. If you scroll down the examples section in the left, you can click any of the examples like − Movies Database, Data Visualization etc. to invoke it and see how QlikView works. Feel free to click around! On moving to the right, you notice the Recent and Favourites link, which show all the recently visited QlikView documents and the documents you want to visit frequently. Menu Commands On closing the ‘Getting Started’ window, we get the main interface with all the available Menu commands. They represent the entire set of features available in QlikView. Given below is an overview of each section of the Menu Commands. File Menu This menu is used to create a new QlikView file and open the existing files from both local system and QlikView server. The important features in this menu are − Mail as attachment to email the currently open document as an attachment. Reduce Data to view only the report layout and database structure without any data. Table viewer option is used to see the structure of the tables, fields and their association in a graphical view. Edit Menu This menu is used to carry out the editing options like copy, paste, cut and using format painter. The important features in this menu are − Active All option activates all the sheet objects present in the opened sheet. Removeto remove a sheet from the active window. Advanced search option is used to do a search with advanced search expressions using multi box. View Menu This menu is used to view the standard toolbars and zoom in/ zoom out features. It also displays all the active sheets as a cascade menu. The important features in this menu are − Turn on/off WebView mode toggles the WebView mode and local view mode. Current Selections displays the field name and file values of the selected sheet objects. Design Grid is used to toggle the sheet object placeholders for active object(s) and snap-to-grid for sizing and moving objects in the layout. Selection Menu This menu is used to select and clear the selection of values in the sheet objects. It also provides the feature of going back and forward into different logical statements of the sheet, you are working on. The important features in this menu are − Lock locks all the values in current selection. Unlock unlocks all the locked values in the current selection. Layout Menu Layout Menu is used to add tabbed sheets, select different sheets and rearrange sheet objects. The important features in this menu are − Promote sheet moves the current sheet or tab one step forward. Demote sheet moves the current sheet or tab one step backward. Delete sheet deletes the active sheet and everything in it. Settings Menu Settings menu is used to set the user preferences, document properties, and sheet properties. The important features in this menu are − Variable overview all the non-hidden variables and their values in a single list. Expression Overview shows expressions from the document, sheet and sheet objects as a single list. Bookmark Menu This menu is used to create bookmarks to different documents for faster retrieval. Reports Menu Reports menu is used to create new reports and edit the existing reports. You can edit the layout, add pages to the report, and also delete reports. Tools Menu Tools menu is a very prominent menu, frequently used for creating charts and opening the QlikView management console. The important features in this menu are − Quick Chart Wizard creates simple charts without using the great number of different settings and options available. Time Chart Wizard creates time series charts. Statistics Chart Wizard is used to apply common statistical tests on data. Object Menu This menu is used to create new sheet objects and modify the existing ones. The sheet properties option opens the page to set the parameters defining the sheet. The important features in this menu are − Copy Sheet − creates a copy of the sheet along with the all the sheet objects. Copy Image to Clipboard − Copies a bitmap picture of the sheet area to Clipboard. Remove − completely removes the sheet along with the sheet objects. The Window and Help menus are used to organize the different windows of QlikView application and provide help documentation. Print Page Previous Next Advertisements ”;

QlikView – Desktop Installation

QlikView – Installation ”; Previous Next Download QlikView The Free Personal Edition of QlikView can be downloaded from QlikView Personal Edition. You need to register with your details to be able to download. After downloading, the installation is a very straightforward process in which you need to accept the license agreement and provide the target folder for installation. The screen shots given below describe the entire setup process. Start the installation wizard Double clicking the QlikViewDesktop_x64Setup.exe will present a screen to select the language of your choice. On selecting English, the following screen is displayed. Then click Next. Accept the License Agreement Read the license agreement and if you agree, choose the “I accept the terms in the license agreement” option. Then click “Next”. Provide your Details Provide your name and organization details. Then Click “Next”. Choose the Destination Folder You may accept the default destination for installation or alter it. Then click “Next”. Choose the Setup Type Choose the setup type as “Complete”. Then click “Next”. Begin Installation In this screen, you finally decide to really start the installation. You can still go back and change some options if needed. Assuming you are fine with everything so far, click “Install”. Installation Complete The installation completion screen appears after successful installation. Click “Finish”. Verify the Installation You can verify the installation by going to the Windows Start menu and clicking on the QlikView icon. The screen appears as shown below. You are now ready to learn QlikView. Print Page Previous Next Advertisements ”;

QlikView – Rank Function

QlikView – Rank Function ”; Previous Next The Rank() function in QlikView is used to display the rank of the values in a field as well as return rows with specific rank value. So it is used in two scenarios. First scenario is in QlikView charts to display the ranks of the values in the field and second is in Aggregate function to display only the rows, which have a specific rank value. Input Data The data used in the examples describing Rank function is given below. You can save this as a .csv file in a path in your system where it is accessible by QlikView. Product_Id,Product_Line,Product_category,Quantity,Value 1,Sporting Goods,Outdoor Recreation,12,5642 2,Food, Beverages & Tobacco,38,2514 3,Apparel & Accessories,Clothing,54,2365 4,Apparel & Accessories,Costumes & Accessories,29,4487 5,Sporting Goods,Athletics,11,812 6,Health & Beauty,Personal Care,21,6912 7,Arts & Entertainment,Hobbies & Creative Arts,58,5201 8,Arts & Entertainment,Paintings,73,8451 9,Arts & Entertainment,Musical Instruments,41,1245 10,Hardware,Tool Accessories,2,456 11,Home & Garden,Bathroom Accessories,36,241 12,Food,Drinks,54,1247 13,Home & Garden,Lawn & Garden,29,5462 14,Office Supplies,Presentation Supplies,22,577 15,Hardware,Blocks,53,548 16,Baby & Toddler,Diapering,19,1247 17,Baby & Toddler,Toys,9,257 18,Home & Garden,Pipes,81,1241 19,Office Supplies,Display Board,29,2177 Load Script The above data is loaded to the QlikView memory by using the script editor. Open the Script editor from the File menu or press Control+E. Choose the Table Files option from the Data from Files tab and browse for the file containing the above data. Click OK and press Control+R to load the data into QlikView”s memory. Creating Chart with Rank() Function Next, we follow the steps given below to create a chart, which shows the rank of the filed Value described with respect to the dimension Product_Line. Select the Chart Type Click on the Chart wizard and choose the option straight table as the chart type. Click Next. Select the Chart Dimension From the First Dimension drop down list, choose Product_Line as dimension. Click Next. Define the Chart Expression In the custom expression field, mention the rank expression as shown below. Here we are considering the numeric field named Value, which represents the Sales value for each category under each Product Line. Click Next. Displaying the Chart On clicking Finish in the above step, the following chart appears which shows the rank of the sales value of each Product Line. Using Aggregate Function with Rank The aggregate functions like − max, min etc. can take rank as an argument to return rows satisfying certain rank values. We consider the following expression to be out in the script editor, which will give the rows containing highest sales under each Product line. # Load the records with highest sales value for each product line. LOAD Product_Line, max(Value,1) FROM [E:Qlikviewdataproduct_sales.csv] (txt, codepage is 1252, embedded labels, delimiter is ”,”, msq) group by Product_Line; Creating Sheet Object Let us create a Table Box sheet object to show the data generated by the above given script. Go to the menu Layout → New Sheet Object → Table Box. The following window appears in which we mention the Title of the table and select the required fields to be displayed. Clicking OK displays the data from the CSV file in the QlikView Table Box as shown below. Print Page Previous Next Advertisements ”;

Power BI – DAX Basics in Power BI

DAX Basics in Power BI ”; Previous Next In this chapter, you will learn how to use various DAX functions in Power BI. DAX Introduction DAX (Data Analysis Expressions) is a formula expression language and can be used in different BI and visualization tools. DAX is also known as function language, where the full code is kept inside a function. DAX programming formula contains two data types: Numeric and Other. Numeric includes – integers, currency and decimals, while Other includes: string and binary object. Following is an example of DAX formula, which uses a function to calculate a column in a table. DAX function can also include other functions, conditional statements, and value references. DAX Functions In Power BI, you can use different function types to analyze data, and create new columns and measures. It includes functions from different categories such as − Aggregate Text Date Logical Counting Information Power BI provides an easy way to see the list of all functions. When you start typing your function in the formula bar, you can see the list of all functions starting with that alphabet. Aggregate Functions DAX has a number of aggregate functions. MIN MAX Average SUM SUMX Counting Functions Other counting functions in DAX include − DISTINCTCOUNT COUNT COUNTA COUNTROWS COUNTBLANK Logical Functions Following are the collection of Logical functions − AND OR NOT IF IFERROR TEXT Functions REPLACE SEARCH UPPER FIXED CONCATENATE DATE Functions DATE HOUR WEEKDAY NOW EOMONTH INFORMATION Functions ISBLANK ISNUMBER ISTEXT ISNONTEXT ISERROR DAX Calculation Types In Power BI, you can create two primary calculations using DAX − Calculated columns Calculated measures When you navigate to the Modeling tab, you can see a New Column option at the top of the screen. This also opens the formula bar where you can enter DAX formula to perform the calculation. DAX – Data Analysis Expression is a powerful language used in Excel to perform calculations. You can also rename the column by changing the Column text in the formula bar. In the following example, we have created a new column: Product Code (Product_C), which is derived from the last 3 characters of Prod_Id column. Following is the formula − Product_C = RIGHT( Sheet1[Prod_Id],3) To create a calculated measure, navigate to New Measure tab under Modeling. This will add a new object under the Fields tab with the name Measure. You can write DAX formula to calculate the value of the new measure, as we did for the new calculated column. Print Page Previous Next Advertisements ”;

Power BI – Discussion

Discuss Power BI ”; Previous Next Power BI is a Data Visualization and Business Intelligence tool that converts data from different data sources to interactive dashboards and BI reports. Power BI suite provides multiple software, connector, and services – Power BI desktop, Power BI service based on Saas, and mobile Power BI apps available for different platforms. These set of services are used by business users to consume data and build BI reports. This tutorial covers all the important concepts in Power BI and provides a foundational understanding on how to use Power BI. Print Page Previous Next Advertisements ”;

Power BI – Excel Integration

Power BI – Excel Integration ”; Previous Next In this chapter, you will learn how to integrate excel with Power BI. Using Excel Data Using Power BI, you can also import Excel workbook file from the local drive into Power BI. To import data from the excel sheet, you have to ensure that each column has a proper name. To import an Excel file in Power BI, navigate to Get Data → Files → Local Files. Importing xls Files In Power BI Service, navigate to My Workspace → File → Local File. Also note that it is not necessary your Excel file should only be saved on the Local Drive. You can also import an Excel workbook from OneDrive or even from SharePoint. Once the dataset is imported, you are ready to create the reports in Power BI. Imported dataset is available under “DATASETS” option in Power BI menu. Double-click Datasets. Then, navigate to the Explore tab. This will open a new Report Canvas. All the fields from your table and corresponding columns are available under the Fields option on the right side of the screen. To create a report, select any visualization and add the fields from the table to visualization. Print Page Previous Next Advertisements ”;

Sharing Power BI Dashboards

Sharing Power BI Dashboards ”; Previous Next In this chapter, you will learn how to share Power BI dashboard for report sharing, printing, publishing, etc. Using Power BI Desktop for Report Sharing Once BI reports are created in Power BI desktop, you can also share the reports with other business users. All BI reports, dashboards, and data can be shared with other colleagues and business users in the organization. You can share reports using the following methods − Publish reports using Power BI Service Content Packs combine dashboard, report, and datasets obtained in BI desktop tool Create Groups and assign specific rights to different users for report sharing Use Power BI mobile apps to access share dashboards and reports Let us see how to publish a BI report using Power BI desktop tool. Once the report is created, navigate to the Publish button on the Home tab in Power BI desktop. Once you select the Publish service, your visuals, custom measures and reports are all packaged and published to Power BI service. Power BI files have an extension .pbix files. When the upload is in process, you get a dialog box that Publishing is in process. Once the upload is complete, you will get a confirmation message announcing the “Success”. You can also view Quick Insights and open the shared report from the dialog box. Printing Power BI Dashboards It is also required sometimes to take printouts of your reports and dashboards. With Power BI, you can take prints of your BI reports and dashboards. To take a Printout of the report, navigate to Power BI service and click the “…” option. It will open a Print dialog box. You can select the Printer on which you want to take the printout of the report. You can also select different Print options such as Portrait/Landscape, Margins, Header or Scale. Export Options In Power BI, you can also use different Export options to export data from BI report. To use the export option, navigate to Power BI service and select the BI report you want to export. When you click the Export to option, it generates a CSV file. In Power BI, you can also export/view a report directly by navigating to File → Print option. Publishing Report to Web In Power BI, it is also possible to publish a BI report to web or share it via email. To publish a report to the web, you have to navigate to Power BI service → My Workspace. Once you open the report that you want to publish, navigate to the File tab → Publish to Web. Once you select this option, it opens a new dialog that creates an embed code for this report to include in the website or email. Option says: Get a link or embed code that you can include on a public website. You may use publish to web functionality to share content on a publicly available website. You may not use this functionality to share content internally, which includes through your email, your internal network, or intranet site. Publish a live version that will remain synchronized with the source report in Power BI. Any changes you make to the report will immediately be reflected in the published public version. When you select – Create Embed code, Power BI prompts that you want to share your data with everyone on the internet. The following message is displayed: You are about to create an embed code for this report. Once published, anyone on the Internet will be able to access the report and the data it contains, and Microsoft may display the report on a public website or a public gallery. Before publishing this report, ensure you have the right to share the data and visualizations publicly. Do not publish confidential or proprietary information, or an individual”s personal data. If in doubt, check your organization”s policies before publishing. Note − You can publish the report as a web page and any user with the link can view it. The link can be sent via email or it can be used as an iframe in a web page. Deleting an Embed Code Let us say, you want to delete an embed code. Navigate to the Gear icon at the top of the screen as shown in the following screenshot. Then go to Manage Embed codes. To remove an embed code click the ellipsis mark (…) in front of the report name and select the Delete option. When you click the Delete option, it will ask you if you want to delete publish to web code. Once you are sure, click Delete. Using Content Pack In Power BI, you can also share dashboard, report, and dataset as a package with your colleagues. To create a content pack, click the Gear box icon in Power BI workspace as shown in the following screenshot. Once you select Create content pack, you will be prompted with a new dialog box. You can choose if you want to distribute this content pack with Specific Groups or My Entire Organization. If you want to share this with specific people, you have to enter email addresses. You can also add a Title and description of the content pack as shown in the following screenshot. At the bottom of the page, you have an option to select the components you want to publish. You can select from the following − Dashboards Reports Datasets Editing Content Pack When a content pack is created, you can also go back and edit the shared objects of the content pack. Whenever you update any dashboard, BI report, you are prompted if you want to update the shared content. Click the Gear box icon under My Workspace → View Content Pack. If you see a small icon in front of the name of the content pack, it shows that the content pack is updated. When you select the edit button, you will reach the home screen, where you

HiveQL – Select Where

HiveQL – Select-Where ”; Previous Next The Hive Query Language (HiveQL) is a query language for Hive to process and analyze structured data in a Metastore. This chapter explains how to use the SELECT statement with WHERE clause. SELECT statement is used to retrieve the data from a table. WHERE clause works similar to a condition. It filters the data using the condition and gives you a finite result. The built-in operators and functions generate an expression, which fulfils the condition. Syntax Given below is the syntax of the SELECT query: SELECT [ALL | DISTINCT] select_expr, select_expr, … FROM table_reference [WHERE where_condition] [GROUP BY col_list] [HAVING having_condition] [CLUSTER BY col_list | [DISTRIBUTE BY col_list] [SORT BY col_list]] [LIMIT number]; Example Let us take an example for SELECT…WHERE clause. Assume we have the employee table as given below, with fields named Id, Name, Salary, Designation, and Dept. Generate a query to retrieve the employee details who earn a salary of more than Rs 30000. +——+————–+————-+——————-+——–+ | ID | Name | Salary | Designation | Dept | +——+————–+————-+——————-+——–+ |1201 | Gopal | 45000 | Technical manager | TP | |1202 | Manisha | 45000 | Proofreader | PR | |1203 | Masthanvali | 40000 | Technical writer | TP | |1204 | Krian | 40000 | Hr Admin | HR | |1205 | Kranthi | 30000 | Op Admin | Admin | +——+————–+————-+——————-+——–+ The following query retrieves the employee details using the above scenario: hive> SELECT * FROM employee WHERE salary>30000; On successful execution of the query, you get to see the following response: +——+————–+————-+——————-+——–+ | ID | Name | Salary | Designation | Dept | +——+————–+————-+——————-+——–+ |1201 | Gopal | 45000 | Technical manager | TP | |1202 | Manisha | 45000 | Proofreader | PR | |1203 | Masthanvali | 40000 | Technical writer | TP | |1204 | Krian | 40000 | Hr Admin | HR | +——+————–+————-+——————-+——–+ JDBC Program The JDBC program to apply where clause for the given example is as follows. import java.sql.SQLException; import java.sql.Connection; import java.sql.ResultSet; import java.sql.Statement; import java.sql.DriverManager; public class HiveQLWhere { private static String driverName = “org.apache.hadoop.hive.jdbc.HiveDriver”; public static void main(String[] args) throws SQLException { // Register driver and create driver instance Class.forName(driverName); // get connection Connection con = DriverManager.getConnection(“jdbc:hive://localhost:10000/userdb”, “”, “”); // create statement Statement stmt = con.createStatement(); // execute statement Resultset res = stmt.executeQuery(“SELECT * FROM employee WHERE salary>30000;”); System.out.println(“Result:”); System.out.println(” ID t Name t Salary t Designation t Dept “); while (res.next()) { System.out.println(res.getInt(1) + ” ” + res.getString(2) + ” ” + res.getDouble(3) + ” ” + res.getString(4) + ” ” + res.getString(5)); } con.close(); } } Save the program in a file named HiveQLWhere.java. Use the following commands to compile and execute this program. $ javac HiveQLWhere.java $ java HiveQLWhere Output: ID Name Salary Designation Dept 1201 Gopal 45000 Technical manager TP 1202 Manisha 45000 Proofreader PR 1203 Masthanvali 40000 Technical writer TP 1204 Krian 40000 Hr Admin HR Print Page Previous Next Advertisements ”;