Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
BARC’s The BI Survey 19 makes it official. BI users love Qlik. GET REPORT
rxp03570
Contributor

Looping account_id to limit load on Database

Hi All,

 

I'm trying to pass account_id from 1 to 1000, if I do a select * without any filter the app is creashing as the data is too big for it to handle. Can someone suggest on how to create a loop for the same.

 

Something that I have tried:

For i=0 to 1000

Let vAccount_ID =Peek( i);

AccountLoad:

Select * from apps.data_load where account_id='$(vAccount_ID)';

 

Will a query like this workout.

Thanks,

1 Solution

Accepted Solutions
Highlighted
Partner
Partner

Re: Looping account_id to limit load on Database

Hi @rxp03570

 

This should work just fine

 

Accountload:

Load * inline [

account_id

];

For i=0 to 1000

concatenate(Accountload)

Select * from apps.data_load where account_id='$(i)';

next i

 

Br.

Teis

View solution in original post

4 Replies
balabhaskarqlik
Honored Contributor

Re: Looping account_id to limit load on Database

AccountLoad:
Load * ;

Select * from apps.data_load where account_id <= 1000;

Re: Looping account_id to limit load on Database

Your Query loaded from SQL which is not equal to Qlikview LET statement. So, We can't by pass LET statement to SQL queries. If you exactly need in between. You can attempt using SQL or Qlikview like follows

SQL Select * from apps.data_load where account_id Between 0 and 1000;

Else in Qlikview,

Table:

Load * Where account_id >=0 and account_id <= 1000;

Select * from apps.data_load;

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
Highlighted
Partner
Partner

Re: Looping account_id to limit load on Database

Hi @rxp03570

 

This should work just fine

 

Accountload:

Load * inline [

account_id

];

For i=0 to 1000

concatenate(Accountload)

Select * from apps.data_load where account_id='$(i)';

next i

 

Br.

Teis

View solution in original post

rxp03570
Contributor

Re: Looping account_id to limit load on Database

Thanks for the reply, this seems to work.