Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
srihitha
Contributor III
Contributor III

semantic load

Presidents:
LOAD * INLINE [
Sequence, Name, Party
1, George Washington, Federalist
2, John Adams, Federalist
3, Thomas Jefferson, Dem.-Rep
4, James Madison, Dem.-Rep
5, James Monroe, Dem.-Rep
6, John Quincy Adams, Dem.-Rep
7, Andrew Jackson, Democrat
8, Martin Van Buren, Democrat
9, William Henry Harrison, Whig
10, John Tyler, Democrat
11, James Knox Polk, Democrat
12, Zachary Taylor, Whig
13, Millard Fillmore, Whig
14, Franklin Pierce, Democrat
15, James Buchanan, Democrat
16, Abraham Lincoln, Republican
17, Andrew Johnson, Republican
18, Ulysses Simpson Grant, Republican
19, Rutherford Birchard Hayes, Republican
20, James Abram Garfield, Republican
21, Chester Alan Arthur, Republican
22, Grover Cleveland, Democrat
23, Benjamin Harrison, Republican
24, Grover Cleveland, Democrat
25, William McKinley, Republican
26, Theodore Roosevelt, Republican
27, William Howard Taft, Republican
28, Woodrow Wilson, Democrat
29, Warren Gamaliel Harding, Republican
30, Calvin Coolidge, Republican
31, Herbert Clark Hoover, Republican
32, Franklin Delano Roosevelt, Democrat
33, Harry S Truman, Democrat
34, Dwight David Eisenhower, Republican
35, John Fitzgerald Kennedy, Democrat
36, Lyndon Baines Johnson, Democrat
37, Richard Milhous Nixon, Republican
38, Gerald Rudolph Ford, Republican
39, James Earl Jr Carter, Democrat
40, Ronald Wilson Reagan, Republican
41, George Herbert Walker Bush, Republican
42, William Jefferson Clinton, Democrat
43, George Walker Bush, Republican
44, Barack Hussein Obama II, Democrat
];

SemanticTable:
Semantic Load
Previous(Sequence)-1 as Sequence,
'Successor' as Relation,
Sequence as Sequence,
'Predecessor' as Relation
resident Presidents;

 

I don't understand how the relation is formed between the highlighted fields. How Previous(Sequence)-1 is related to successor and Sequence is related to Predecessor. I understand the below syntax of semantic load

Semantic SELECT Object1, Relation, Object2, InverseRelation from table1;

Above code works fine .I have added  field 'Relation' to filter pane .I understood the usage but could not understand how code is written for semantic load

 

Note : I have gone through all links for semantic load in qlik help both for qlik view and qlik sense.

Labels (3)
1 Reply
hic
Former Employee
Former Employee

I am happily surprised to see that "Semantic" is used. It is an old feature that very rarely is used in real life.

The semantic fields are not ordinary fields that can "hold a selection". Instead, they are actions that perform a selection in another field. In QlikView the semantic fields are visualized as buttons to mark that it's an action.

Henric_Cronstrm_0-1653297743081.png

 

Usually, semantic fields are used for self-references, like in your case: You have selected a President in the field "Name" and you want to find the successor. By clicking on the 'Successor' the Qlik engine will make a selection that picks out another "Name" - the next one. However, you need to use "Previous(Sequence)" instead of "Previous(Sequence)-1".

To understand the logic, you need to look at the table that the Semantic Load creates. It has four columns, with field names duplicated.
If you have the value '2' possible, clicking 'Successor' will select '3'.

Henric_Cronstrm_1-1653297765616.png

 

And if you have the value '3' possible, clicking 'Predecessor' will select '2'.

Henric_Cronstrm_2-1653297776158.png