Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
gsandip
Contributor
Contributor

How to use dynamic number with autogenerate in qlik sense?

Hi, I am using below code for implementing section access:

Section Access;
Load * INLINE [
ACCESS, USER.EMAIL, DEALERCODE
USER, abhaskar@maxis.com.my, 0HFS1.00001
USER, abhaskar@maxis.com.my, 0HFS1.00002
USER, abhaskar@maxis.com.my, 0HFS1.00003
ADMIN, gsandip@maxis.com.my, *
ADMIN, ANDREWTL@maxis.com.my, *
];
Section Application;
T1:
LOAD *,
NUM AS DEALERCODE;
LOAD
RecNo() AS NUM
AUTOGENERATE 5;

Now , my records at section access will be increased dynamically and need to use dynamic number like 5 in Section Application area based on the number of records in section access data.

May I know how to generate that number(which is mentioned as 5 ) dynamically based on the number of data?

Labels (1)
  • SaaS

1 Reply
micheledenardi
Specialist II
Specialist II

You can use variables to define the number of records for Autogenerate() function.

 

Section Access;

SA:
Load * INLINE [
ACCESS, USER.EMAIL, DEALERCODE
USER, abhaskar@maxis.com.my, 0HFS1.00001
USER, abhaskar@maxis.com.my, 0HFS1.00002
USER, abhaskar@maxis.com.my, 0HFS1.00003
ADMIN, gsandip@maxis.com.my, *
ADMIN, ANDREWTL@maxis.com.my, *
];

let vNumberOfRecords=NoOfRows('SA');

Section Application;

T1:
LOAD *,
NUM AS DEALERCODE;
LOAD
RecNo() AS NUM
AUTOGENERATE(vNumberOfRecords);

 

Michele De Nardi
If a post helps to resolve your issue, please accept it as a Solution.