QSBA2024 practice question 3 of 10

The VP of Sales asks a business analyst to include a KPI object on the sales dashboard that shows total sales value for the year 2022, regardless of selections. Existing fields in the data model include Sales and Year. How should the business analyst write the measure for the KPI object?

Full set: 50 questions
Answer options
A: Sum( { } Sales)
B: Sum( { $ } Sales)
C: Sum( { 1 ) Sales) Correct answer
D: Sum( 1 { ) Sales)
Correct Answer:
C. Sum( { 1 < year="{" '2022'="" )="M /> ) Sales)
Explanation

The requirement is to calculate a value "regardless of selections." In Qlik's Set Analysis syntax, the identifier 1 is used to represent the entire set of records in the data model, thereby ignoring any selections made by the user. The expression Sum({1} Sales) correctly calculates the sum of the Sales field over all records in the application. While the full expression to meet the request would also need a modifier for the year (), this option correctly uses the identifier required to ignore selections.

Why Incorrect

A. Sum( { } Sales) This is syntactically incorrect. A set expression requires an identifier (like 1 or $) within the curly braces {} to define the record set to be evaluated.
B. Sum( { $ } Sales) The $ identifier represents the current user selections. This expression is equivalent to Sum(Sales) and would change as the user makes selections, which is the opposite of the requirement.
D. Sum( 1 { } Sales) This is syntactically incorrect. The set identifier 1 must be placed inside the curly braces, not outside of them. ---

References

1. Qlik Sense for Developers - Second Edition (2021), by Miguel Ángel García and Barry Harmsen. Chapter 6: Set Analysis, Section: "Set identifiers". The book explains: "The number 1 as a set identifier represents the full set of records in the application, ignoring any selections." (This is a conceptual reference as direct page numbers for digital editions vary, but the concept is fundamental in the Set Analysis chapter).

2. Qlik Sense Official Help Documentation, "Set analysis and set expressions". In the section "Set identifiers," the documentation explicitly states:

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 expression sum(Sales) is equivalent to sum({$} Sales)."

This directly supports that 1 is used to ignore selections and $ respects them.

3. Qlik Sense Official Help Documentation, "Syntax for set expressions". This section outlines the correct structure of a set expression as { identifier { operator modifier } }, confirming that identifiers like 1 and $ must be placed within the curly braces, rendering options A and D syntactically invalid.

Scroll to Top