Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Neha121
Contributor III
Contributor III

Special characters in Qlik Sense Scripts

Hi Team,

    In below sample code I want to understand below few things..

1. % prefix in table name - when do we use %?

2. % prefix in field name - when do we use %?

3. # prefix in field name - when do we use #?

4. %% prefix in table name - when do we use %%?

5. IF(#d.Field1 <> PREVIOUS(#d.Field1), 1, PEEK([%Field5]) + 1) AS [%Field5]  what will this Peek()  statement do?

6. Are there any resources for learning theses complex scripts in Qliksense? If you can share the link it would be very helpful

Sample code

%Table1:
LOAD
#d.Field1,
Field2,
Field3,
Field4
FROM [xyz.qvd] (qvd)
;

%%Table1:
LOAD
#d.Field1,
Field2,
Field3,
Field4,
IF(#d.Field1 <> PREVIOUS(#d.Field1), 1, PEEK([%Field5]) + 1) AS [%Field5] //asc 1,2,...
RESIDENT %Table1;

Labels (1)
1 Reply
rubenmarin

Hi, so far I know those prefixes doesn't meant anything unless there is another instruction that gives them an utility.

In example you can set HidePrefix = '#', and this will make fields starting by '#' to not appear on selections and some lists of fields.

The % used in the table name seems something the developer used to avoid to use the same table name, I will prefer to use the 'tmp' prefix and give a name with some meaning but it's just a naming metodology that each one decides.

Fields Named with # usually means a field used in counts, or more general for number, but again, it's just the name given by the developer.