Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
nikhilgarg
Specialist II
Specialist II

Can anyone explain following code ??

Hey,

Can anyone explain the following code and also what is semantic load.

Semantic Load

  Previous(Sequence) as P1,

  'Successor' as Relation,

  Sequence as P2,

  'Predecessor' as Relation

resident Presidents

Thanks

17 Replies
Anonymous
Not applicable

Hey Nikhil,

Please refer Page No. 367 of 942  of the same book.

Hope information on that page will clear your doubt.

Thanks,

Geeta

nikhilgarg
Specialist II
Specialist II
Author

Hey,

But can you please explain what is Objects here??

Thanks

Anonymous
Not applicable

Hey Nikhil,

The extract of PageNo. 260 of 942 which is as follows :-

--------------------------------------------------------------------------------------------------------------------------------

"Tables containing relations between objects can be loaded through a semantic prefix.

The syntax is:

semantic( loadstatement | selectstatement)

Examples:

Semantic Load * from abc.csv;

Semantic Select Object1, Relation, Object2, InverseRelation from

table1;

Tables loaded through a semantic statement cannot be concatenated."

---------------------------------------------------------------------------------------------------------------------------------

Above snipet clearly signifies that "Object" in semantic  refers to field(Column) in a table  .

Thanks,

Geeta

nikhilgarg
Specialist II
Specialist II
Author

Hey,

Thanks Geeta . My doubt is resolved.

Can You please explain this also:


Previous(Sequence) as Sequence,   // What is the value of (Sequence) here ?? And value of (Previous Of sequence) ??

'Succesor' as Relation,

Sequence,

'Predecessor' as Relation

resident President_Data;

According to me default value of Sequence should be latest value of U.S President. But when i click Predecessor it shows me Barack Obama and when i click Successor it shows me George Washington. Hows that possible??

Please resolve the doubt.

Thanks

Anonymous
Not applicable

Hey Nikhil,

Here use of 'Previous()' comes into picture.

Previous()  will save the above value of  the current row of 'sequence field' that is why when you click predecessor ,it shows you the row that belongs to (current sequence -1) .

Means,keep in mind the sequence field value when you click on Predecessor or successor value of ListBox (Relation)  available in the Presidents tab of the application.

Hope it will help you.

Thanks,

Geeta

nikhilgarg
Specialist II
Specialist II
Author

Hey thanks but ,

If default value of Sequence is of current president , Right ??

Then, if i click Successor which is Previous(Sequence) then , it should show previous of Barack obama , i.e GWBush(at No.43). But it is not happening right.

Please help.

Anonymous
Not applicable

Hi Nikhil,

If you see carefully the rules of Semantic (Page No. 385 of 942) ,it tells that 

--------------------------------------------------------------------------------------------------

Normally four columns are used,

the first one containing the field values that have a relation to some other

field value

and the third one containing the related field value.

The second column must contain the names

of the relations,

and finally, the fourth one must contain the names of the inverse relations.

If three columns are used, no explicit names for the inverse relations can be given. The names given in the

second column are used both for the relation and the inverse relation. The names are then preceded or followed

by arrows.

--------------------------------------------------------------------------------------------------

Normally selections are made explicitly by clicking on the field values(here field value means values of the same column) that are interesting.

There is, however,

also a way to make selections indirectly through semantic links. These are similar to field values(here field values of field comes from two different columns having same name as 'Relation'),

but with the difference that they describe the relations between the objects rather than the objects themselves.

They appear as a list of buttons.

When clicking on a semantic link, a selection is made in an other field.

now ,you can  understand  the meaning of a line

'they describe the relations between the objects rather than the objects themselves'

Semantic Load

  Previous(Sequence) as P1,

  'Successor' as Relation,

  Sequence as P2,

'Predecessor' as Relation

resident Presidents

So,we only have to follow the rules of semantic ,Qlikview will automatically parse that code and consider previous(sequence) as predecessor and not successor.

Hope this will help.

Thanks,

Geeta

nikhilgarg
Specialist II
Specialist II
Author

HEy,

Ohhk Thanx.