Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

custom counter in load script

Hi,

Please help me.

I am trying to run a custom counter using a variable 'x' with incremental value 1 within a load scripts which is loading data from a resident table .

Please someone respond. It's urgent.

Thank You,

Rahul Krishan Goyal

11 Replies
Not applicable
Author

Hi Sunny,

Following are the tables;

A_FF_ONE:

LOAD

f_tgt as ff_tgt,

f_source as ff_source,

f_SSID as ff_SSID,

f_rssi as ff_rssi,

f_imp_day as ff_imp_day,

f_imp_date as ff_imp_date,

f_imp_time as ff_imp_time,

f_imp_year as ff_imp_year,

ff_time as fff_time,

if (ff_time > 6,1,0) as return_cust

order by f_source,f_imp_date,f_imp_time;

let custom_counter=1;

A_FULL_FINAL:

Load

ff_source as fff_source,

ff_SSID as fff_ssid,

ff_imp_date as fff_imp_date,

ff_imp_time as fff_imp_time,

return_cust as f_return_cust,

$custom_counter as cust_count,

if((return_cust=1 and fff_time > 6 and ff_source=previous(ff_source)),custom_counter=custom_counter+1

if(return_cust=0 and fff_time < 6 and ff_source=previous(ff_source),custom_counter)) as f_source_cntr

resident A_FF_ONE

order by ff_source,ff_imp_date,ff_imp_time;

custom_counter=custom_counter+1;

Now I want to run a custom counter as 'custom_counter' with incremental 1 in table 'A_FULL_FINAL'  so that I capture the required values of custom_counter in f_source_cntr.

So the issue is, currently, the custom counter is giving me value 1 only for all the records fetched from table A_FF_ONE.

Please help.

Again I would like to clarify that I want to run a counter in second table with incremental one without using recno() or rangesum.

Thanks,

Not applicable
Author

Hi Sunny,

I am waiting for your response.

Thanks,

Rahul