Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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;
Hi, @Neha121
I think '%' is used to make hide the field on the sheet via the hideprefix system function.
For more information on Hideprefix, see the link below.
https://helpa.qlik.com/en-US/sense/August2023/Subsystems/Hub/Content/Sense_Hub/Scripting/SystemVaria...
But as I know, the Hideprefix can only hide fields, but I don't know what purpose it was used in front of the table name.
And learning about scripts will be very helpful if you refer to various cases in the Qlik community and 'script syntax and chart effects' in Help.
Reply, thanks!
I have not typically seen "%" in table names. I can't suggest what they mean here.
It's common to prefix key field (not table) names with "%" to indicate they are keys.
It's somewhat common to prefix measure fields with # so they sort together. It also helps to address the problem of a field and a master measure sharing the same name. We can name the field "#Sales" and the measure "Sales".
You can read about what the peek() function does in the Help here: https://help.qlik.com/en-US/sense/August2023/Subsystems/Hub/Content/Sense_Hub/Scripting/InterRecordF...
-Rob
Hi, Thank you for your reply. Can you paste some sample posts for script syntax and chart effects. it will help me to search and understand what type of post you are referring.
Hi, @Neha121
Help page for syntax that makes up the Qlik script.
It will be helpful to read the sections below in order, starting with "Script Statement and Keywords."
The 'HidePrefix' you asked is on 'Working with variables in the data load editor' - 'System variables' - 'HidePrefix' section.
Reply, thanks!