Qlik Notes
Qlik Notes
Joins:
Keeps:
Note: Frequency increases while doing Joins, and single frequency is seen while doing keep.
Resident Load:
1. If we want to Perform some Calculations on an already loaded table, then we create a new table
and do calculations and we take Resident of that Table.
2. Aggregation will not work on Base Table; in this scenario we use Resident Load.
Preceding Load:
1. In Preceding load, we can do multiple calculation & Transformation within a Load script.
2. If we want to do calculation or any aggregation without creating a new table that time, we use
Preceding load.
3. Using a preceding load, you don’t need to perform the same calculation several times.
4. Cross Table, Interval match, Join not supported in Preceding Load.
Incremental Load:
1. If we want to update or insert new records at that time, we use Incremental Load.
2. Incremental Load is of 3 types:
A- Insert Only (Do not validate Duplicate Records)
B- Insert & Update (we can delete Duplicate Records from here)
C- Insert, Update & Delete.
Concatenation:
When we have common fields between both the tables that time we do concatenate.
Inline load :
Inline load is a type of data load that can be used when you do not have a data source. The data can be
entered manually or by using the wizard within Qlik View or Qlik Sense.
Mapping:
Generally, we do Mapping when we have 2 tables and in 1 Table when we have 2 fields in 1 Table with
1 common key and we have Attribute key that time we do Mapping.
Binary Load:
Binary Load replicates the data model of an existing Qlik View document into another Qlik View
document without accessing the original data source.
• How are KPI’s or critical business metrics are performing displaying over a gauge chart.
8. Mekko Chart (2 Dimension and 1 measure):
• Mekko Chart is very similar to Staked Bar Chart, but it has another additional
measurement which is the width and that is a great way to display breakdowns in
ratios and actual breakdowns.
• The Grid Chart is similar to the scatter chart but plot dimension value on the axes and uses an
expression to determine the plot symbol.
• These Grid Charts are often used to show the performance or the relationship among similar
data points.
• It shows the performance over a period of time.
12.Treemaps:
• Use a Tree map when you need a large amount of hierarchical data, but space is constrained.
• Tree maps should be primarily used with values that can be aggregated.
Advantages:
1. The maps are economical in that they can be used within a limited space and yet display a
large number of items simultaneously.
2. When there is a correlation between color and size in tree structure you are able to see
patterns that would be difficult to spot in other ways.
Disadvantages:
1. Tree maps are less useful when there is a significant big difference in the magnitude of
the measured values.
2. Tree maps should not be used when comparing absolute and relative values.
3. Negative values cannot be displayed in Tree maps.
13.Bullet Chart:
• Bullet Chart are gauges with extended options.
• They can be used to visualize and compare performance of a measure to a target value
and to qualitative scale.
Section Access:
1. Section Access is actually a way of dynamically reducing data any user in any Qlik Application.
2. Using Section Access we can define which user can see which number of rows or columns or
combination of both.
3. There are 2 fields mandatory for any section access table to implement.
- Access
- Use rid
4.*means like whatever its mention in section access table you will see.
5. If the field value is not in upper case, then user will not get access but if your column name or field
is not capitalized everyone can see everything, and your section access fails.
6. You can also import section access by taking Binary Load also.
Example:
2021, UK, 95
Section Access;
Section Application;
Then Map the data by making a inline load with field COUNTRY.
7.Section Access takes place on sheet level, column level & Row Level.
Qlik sense:
5. This leads to much more active engaged users. It means there is less data development in the
beginning, because Qlik sense app developers do not need to build script that meet every user
needs. Qlik sense is much easier to use on touch screen's, and is adaptive to different screen
sizes and form factors.
1. 1 Tier Architecture:
In Tier 1 Architecture Qlik hits database and pulls data directly and creates Data Model
and the visualization is done in single QVF.
2. 2 Tier Architecture:
First v take data and create data model and in 2nd tier we will take binary load of the QVF and
create visualization in the same QVF.
3. 3 Tier Architecture:
1st tier we will fetch data in QlikView application and create QVD’s.
In the 2nd tier we will pull QVD’s in QlikView application and create Data Model as per
user requirement.
In the 3RD Tier we will take Binary Load of the 2nd application where we create Data
Model and create the visualization.
The Is Null () Function checks the values for Null and returns -1(True) if it is Null and 0 (False) if it
is not Null.
If we have Null value in the table and if if we want to search, then isNull Function is uses.
1 Null – T
2 - - T
3 Value - F
This Function returns a Null value. It is different from IsNull Function as that returns a logical answer
in True or False, whereas Null () Function returns ‘-‘in place of Null Value.
Example:
0 -
1 Null -
2 - -
3 29 Value
4 Mark Value
SET ANALYSIS:
Set Analysis offers a way of defining set(or group) of data values that is different from normal set
defined by the current selection.
1. Identifiers:
Identifiers define the relationship between the set expression and field values or expression
being evaluated.
Example: sum({$<Year={2009}>}Sales)
The identifier is the dollar sign . $ and means that the set of records to be evaluated consists of all the
records of the current selection.
Identifier Description
1 Represents the full set of all the records in the application, irrespective of any
selections made.
$ Represents the records of the current selection. The set expression {$} is thus the
equivalent to not stating a set expression.
$_1 Represents the next (forward) selection. $_2 represents the next selection-but-
one, and so on.
MyAltState You can reference the selections made in an alternate state by its state name.
Example Result
sum ({1} Sales) Returns total sales for the document, disregarding selections but not the
dimension.
sum ({$} Sales) Returns the sales for the current selection, that is, the same
as sum(Sales).
sum ({$1} Sales) Returns the sales for the previous selection.
sum ({BM01} Returns the sales for the bookmark named BM01.
Sales)
2. Operators:
Operators are used to include, exclude or intersect parts of or whole data sets.
All Operators use sets as operands and return a set as a result.
Operator Description
+ Union. This binary operation returns a set consisting of the records that belong to
any of the two set operands.
- Exclusion. This binary operation returns a set of the records that belong to the first
but not the other of the two set operands. Also, when used as a unary operator, it
returns the complement set.
* Intersection. This binary operation returns a set consisting of the records that
belong to both of the two set operands.
/ Symmetric difference (XOR). This binary operation returns a set consisting of the
records that belong to either, but not both of the two set operands.
Set operators
Operator Description
+ Union. This binary operation returns a set consisting of the records that belong to
any of the two set operands.
- Exclusion. This binary operation returns a set of the records that belong to the first
but not the other of the two set operands. Also, when used as a unary operator, it
returns the complement set.
* Intersection. This binary operation returns a set consisting of the records that
belong to both of the two set operands.
/ Symmetric difference (XOR). This binary operation returns a set consisting of the
records that belong to either, but not both of the two set operands.
Examples and results
Example Result
3. Modifier:
Modifiers are used to make additions or changes to a selection. Such modification can be
written in the set expression.
A Modifier consists of one or several fields' names, each followed by one or several selections
that can be made in the field.
Modifiers begin and end with <>.
MyField Result
sum ({$<Order Date = Returns the sales for the current selection where Order Date =
Delivery Date>} Sales) Delivery Date.
sum ({1<Region = {US}>} Returns the sales for region US, disregarding the current
Sales) selection.
sum ({$<Region = >} Sales) Returns the sales for the selection, but with the selection
in Region removed.
sum ({<Region = >} Sales) Returns the same as the example above. When the set
identifier to modify is omitted, the inherited state is assumed.
Examples and results
MyField Result
sum ({$<Year= {2000}, Returns the sales for the current selection, but with new
Region={“U*”}>} Sales) selections both in Year and in Region.
1. When 2 tables have more than one common field it will form a synthetic key.
CR:
When 3 or more tables are linked in such a way that it forms a circle.
Like synthetic keys are created, a circular reference can also be the result of unwanted associations in
our data modelling.
FUNCTION:
1. Left:
Starting from the left of the string returns the specified number of characters.
Ex: Left (‘Qlik Sense’,4)
Ans: Qlik.
2. Right:
Starting from the right of the string, returns the specified number of characters.
Ans: Press.
Numeric Function:
1. Ceil ():
It will upgrade the number to topmost value.
Ans: 10 10 10.
2. Floor ():
It will reduce the number it is opposite of ceil.
Egg: 9.1 9.5 9.9
Ans: 9 9 9
3. Round ():
Round the number optionally a parameter can be specified to indicate which multiple to
round to.
Ans: 9 10 10
7. Mid Function:
8. Index Function:
Index (column name/string, substring which need to find the position, occurrence (optional)
Example: =index (‘Qlik 2 Express’), I want to see position of S, by default it will show position
of 1st S.
9. Replace:
It will search the entire string and replace the value.
12. Subfield:
It is used to separate the field.
Example: (‘ Name/DOJ/Salary/Bonus’, ‘/’,2)
Answer. DOJ.
14) Class (): The class function assigns the first parameter to a class interval.
15.) if (): The if function returns a value depending on whether the condition provided with the
function evaluates as True or False.
16) Match (): The match function compares the first parameter with all the following ones and returns
the number of the expression that matches. The comparison is case sensitive.
match( M,'Jan','Feb','Mar') returns 2 if M=Feb.
17). Mix Match (): The mix match function compares the first parameter with all the following ones
and returns the number of the expression that matches. The comparison is case insensitive.
18) pick (): It pick function returns the n:th expression in the list.
19) Wild Match (): The wildmatch function compares the first parameter with all the following ones
and returns the number of expressions that matches. It permits the use of wildcard characters (*
and?) in the comparison strings. The comparison is case insensitive.
21) Interval Match :The Interval Match prefix is used to create a table matching discrete numeric
values to one or more
numeric intervals, and optionally matching the values of one or several additional keys.
Syntax: Interval Match (match field) (load statement | select statement )
22)AutoNumber ():
This script function returns a unique integer value for each distinct evaluated value of expression
encountered during the script execution.
Syntax: auto number(expression [, AutoID])
24) Cross Table (): Cross table is converting rows into columns or vice versa.
Syntax: Cross table (attribute field name, data field name [, n] ) (load statement | select statement)
25) Range Sum (): Range Sum () returns the sum of a range of values. All non-numeric values are
treated as 0, unlike the +
operator.
Syntax: Range Sum (first_expr[, Expression])
Example: 1. Range Sum (1,2,4) Return (7) 2. Range Sum (5,'abc') Return (5)
3. Range Sum (null ()) Return (0).
• If we want to map the values of a column from one table to another then we need to create a
mapping table which should contain only two columns.
• Using Applymap() you can include only one column.
• Use Mapping load then in Mapping table needs two fields at least for mapping.
• It helps us in reducing the number of tables involved in the data model.
• The first column should be the common key column or lookup field
Points to Remember:
• A Mapping table should be loaded before using the Apply Map function.
• Mapping table should have only two columns.
• First Column in the Mapping table should be a key field.
• Mapping Keyword is compulsory before loading any mapping table.
• You cannot use Apply Map function when you need more than one corresponding value from the
second table (Fetches single value per matching record)
• In Apply Map () Mapping table name must be enclosed under single quotes.
Syntax: Apply Map (‘Mapping Table Name’, Common Key Column, ‘Default Value’);
Example:
Table1:
Mapping
LOAD
Invoice ID as ReceiptInvoiceID,
Amount as Receipt Amount
From {path}
Table2:
LOAD
InvoiceDetailID,
Description,
Invoiced,
Apply Map (‘Table1’, Invoiced, 0) as Receipt Amount
FROM {path}
Result:
It will display only one table which contains all fields of applyMap table.
30) FirstSortedValue():
FirstSortedValue() returns the value from the expression specified in value that corresponds to the
result of sorting the sort of weight argument, considering rank, if specified. If more than one
resulting value shares the same sort of weight for the specified rank, the function returns NULL.
The sorted values are iterated over a few records, as defined by a group by clause, or
aggregated across the full data set if no group by clause is defined.
Syntax: FirstSortedValue([ distinct] value, sort-weight [, rank])
Example:
Agger Max Sale: =max (agger (sum (Sale), [Company Name], Product))
Agger Min Product: = min (agger (sum (Sale), Product, [Company Name]))
MinProductSales: =FirstSortedValue(Product,Aggr(sum (Sale), Product, [Company Name]))
MaxProductSales: =FirstSortedValue(Product, -Aggr(sum (Sale), Product, [Company Name]).
32) Concatenate:
• When you have multiple Fact tables in QlikView, it can be handled in 2 ways, by using
concatenate or by using Link tables. If the granularity and columns in the fact tables are same
then you can use Concatenate which will append the tables into one and resulting table will have
the sum of rows of the two tables.
• Use Link table, when the granularity of the facts tables is different and when they are joined to
different dimensions.
• Concatenate and Link Tables are ways to resolve synthetic keys which formulate due to the
presence of multiple fact tables.
33) AutonumberHash256():
This script function calculates a 256-bit hash of the combined input expression values and returns a
unique integer value for each distinct hash value encountered during the script execution. This
function
can be used e.g., for creating a compact memory representation of a complex key.
Create Composite key.
Syntax: autonumberhash256(expression {, expression})
Star:
1. In a star schema, the fact table will be at the center and is connected to dimensional tables.
2. The Tables are completely denormalized in structure.
3. SQL Queries is good as there are a smaller number of joins involved.
4. Data redundancy is high. Occupies more disk spaces.
Snowflake:
1. It's an extension of star schema where dimension tables are further connected to one or more
dimensions.
2. The Tables are partially denormalized in structure.
3. The performance of SQL Queries is little bit less compared to star schema as a more number of
4. joins are involved.
5. Data redundancy is low.occupies less disk space compared to star schema.
Difference between Pivot Table and straight Table:
Pivot Table:
Displays sub-totals.
Data is grouped.
Straight Table:
Fact tables contain measures on which we can do further calculations to get analysis.
For example: Customer dimension will contain details about customer’s name,address, phone number
etc.
When 2 or more tables are not connected with each other with any of the primary key then we create
connection between each other.
What is N-Printing:
N-Printing enables you to schedule and automatically distribute reports to multiple users via mail,
google drive, or folder.
N-Printing reads the Qlikview charts directly from dashboards in qlikview server and generated the
reports based on configuration and distribute those in various tables.