- Qlikview Tutorial
- QlikView - Home
- QlikView - Overview
- QlikView - Desktop Installation
- QlikView - Architecture
- QlikView - Navigation
- QlikView Data Loading
- QlikView - Excel file
- QlikView - Delimited file
- QlikView - XML file
- QlikView - Web file
- QlikView - Database
- QlikView - Inline Data
- QlikView - Resident Load
- QlikView - Preceding Load
- QlikView - Incremental Load
- QlikView - Data - files(QVD)
- QlikView Report Interface
- QlikView - Sheet and Objects
- QlikView - Scripting
- Qlikview - Functions
- QlikView - IntervalMatch
- QlikView - Aggregate Functions
- QlikView - Match Function
- QlikView - Rank Function
- QlikView - Peek Function
- QlikView - RangeSum Function
- QlikView - Documents
- QlikView - List Box
- QlikView - Multi Box
- QlikView - Text Object
- QlikView - Bar Chart
- QlikView - Pie Chart
- QlikView - Dashboard
- QlikView Data Transformation
- QlikView - Transformation Wizard
- QlikView - Fill Function
- QlikView - Column Manipulation
- QlikView - Rotating Tables
- QlikView Data Model
- QlikView - Dimensions & measures
- QlikView - Star Schema
- QlikView - Synthetic Key
- QlikView - Generating Data
- QlikView Data Analysis
- QlikView - Cross Tables
- QlikView - Straight Tables
- QlikView - Pivot Tables
- QlikView - Set Analysis
- QlikView - Joins
- QlikView - Keeps
- QlikView - Concatenation
- QlikView - Master Calendar
- QlikView - Mapping Tables
- QlikView - Circular Reference
- Qlikview Useful Resources
- Qlikview - Questions/Answers
- Qlikview - Quick Guide
- Qlikview - Useful Resources
- Qlikview - Discussion
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
QlikView - RangeSum Function
The RangeSum() function in QlikView is used to do a selective sum on chosen fields which is not easily achieved by the sum function. It can take expressions containing other functions as its arguments and return the sum of those expressions.
Input Data
Let us consider the monthly sales figure as shown below. Save the data with file name monthly_sales.csv.
Month,Sales Volume March,2145 April,2458 May,1245 June,5124 July,7421 August,2584 September,5314 October,7846 November,6532 December,4625 January,8547 February,3265
Load Script
The above data is loaded to 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. Edit the load script to add the following code. Click OK and click Control+R to load the data into QlikView's memory.
LOAD Month, [Sales Volume] FROM [C:\Qlikview\data\monthly_sales.csv] (txt, codepage is 1252, embedded labels, delimiter is ',', msq);
Applying RangeSum() Function
With the above data loaded into QlikView's memory, we edit the script to add a new column, which will give a rolling sum of the month wise sales volume. For this, we also take the help of the peek function discussed in the earlier chapter to hold the value of the previous record and add it to the sales volume of the current record. The following script achieves the result.
LOAD Month, [Sales Volume], rangesum([Sales Volume],peek('Rolling')) as Rolling FROM [C:\Qlikview\data\monthly_sales.csv] (txt, codepage is 1252, embedded labels, delimiter is ',', msq);
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.