You are on page 1of 1

ATiDD Summary Sheet

Qlik Advanced Calculations Advanced Calculations

Expression calculation: • Expression calculation can be entered in many locations in the When are expressions calculated?
Any dynamic calculation in app. In some cases an equal sign in front of the expression or • Expressions on the current sheet are calculated for every state change in Qlik. A state
the Qlik app used in the calculation is needed for the calculation to be evaluated (for change is triggered through selection changes, reload, or trigger a state change.
front-end objects or instance dynamic titles, variable values, etc). • The Now() function is calculated every second regardless of state change.
variables, typically using • Expressions in variables with equal sign in front are evaluated for every state change.
Qlik functions. • In general, Qlik evaluates all selected and possible data (current • Chart expressions in minimized or hidden objects are not calculated, but caption titles
Examples: selected state). But the data included in the expression and show conditions are always calculated.
Expressions in charts, calculation depends on different factors: location, dimensionality, • Chart expressions that are able to take advantage of chart caching do not need to be
variables with = sign, Set Analysis included in the expression, the state (Alternate recalculated.
dynamic titles, calculation states) of the object, the use of qualifiers like DISTINCT, ALL, • Local chart expressions referred to by another chart expression, either through the
conditions, etc. and TOTAL, the totals and subtotals in tables and charts, etc. expression name or the column() function, are not recalculated.

Classification and Clustering Accumulations and rankings: Table functions:


• Clustering uses different similarity measures to Qlik can accumulate values using aggregation expressions: The following functions can be applied in tables to
categorize the data. • RangeSum(first_expr[,expression]) get values of other cells in the same table:
• Classification categorizes the data with the help of • RangeCount(first_expr[,expression]) Above([TOTAL] expression,[offset, count])
• RangeAvg(first_expr[,expression]) Below([TOTAL] expression,[offset, count])
provided training data.
Examples: Top([TOTAL] expression,[offset, count])
RangeSum(1,2,4) = 7 Bottom([TOTAL] expression,[offset, count])
RangeAvg(1,2,4) = 2.3333 Before([TOTAL] expression,[offset, count])
RangeCount(1,2,4) = 3 After([TOTAL] expression,[offset, count])
RangeSum(Above(Sum(Sales),0,3)) Fist([TOTAL] expression,[offset, count])
Qlik can rank and weigh items based on expressions or values using the Last([TOTAL] expression,[offset, count])
Rank functions: • TOTAL - current segment is the entire segment.
Rank([TOTAL [<fld {, fld}>]] expr[, mode[, fmt]]) • Offset - number of rows/columns to skip before
• TOTAL - evaluate across the entire column evaluating. By default, it is 1,current row.
Qlik can perform dynamic clustering using: • mode - represents the result mode (=0 - default, 1 - Lowest rank, 2 - Avg • count - range of count values, one for each of
• The Aggr() function - chart function that groups rank, 3 - Highest rank, 4 - Lowest rank on first row, then incremented by count table rows/columns from the original cell.
different values that have the same result to the 1) Note: This parameter will only works with
expression. • fmt - text representation of the result (=0 -default: "Low value - high Range Function.
• The Class() function - script and chart function that value", 1 - Low value on, 2 - Low value on first row, blank on the Examples:
assigns a dimension or expression value to a class following rows) Above(Sum(Sales),2)
interval. Example: Rank(Sum(Sales),0,2) Below(TOTAL Sum(Sales),2)
• IF statements also allow to classify values dynamically Note: When working with pivot tables and horizontal calculations, you can For pivot tables you can also use:
using expression or calculated dimensions. use HRank([TOTAL [<fld {, fld}>]] expr[, mode[, fmt]]) Dimensionality()- the level of cell indentation
• Qlik also allows R and Python integration to perform FirstSortedValue value, sort_weight [,rank]) - Gets a specific
1
SecondaryDimensionality() – for horizontal
advanced clustering and classification analysis. value based on ranks. FirstSortedValue(Country,Sales, 3) = "UK" dimensions only

You might also like