Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Ranges in script

Good day,

I have the following script:

 

LOAD

AccountCode               as  Account,
CustomerSName          as Customer,
NLControlAccount         as [NL Code],
CompanyKey

SQL

SELECT
AccountCode,
CustomerSName,
NLControlAccount,
CompanyKey

I only want to pull info where the NL Control Account is bigger than '20000000000' and smaller that '400000000000'.

This I want all the NL Control Accounts that is between 300000000000 and 39999999999.

Not sure how to write it in the script.

Please advice.

Thank you

*R*

5 Replies
sujeetsingh
Master III
Master III

aFTER LOADING JUST WRITE THE NESTED IFF STATEMENT

=IF(nil>20000000000 AND <=400000000,'RANGE 1;',

IF(----

sujeetsingh
Master III
Master III

sEE THIS Range function

sujeetsingh
Master III
Master III

yOU CAN USE cLASS FUNCTION TOO

class( var,10 ) with var = 23 returns '20<=x<30'

class( var,5,'value' ) with var = 23 returns '20<= value <25'

class( var,10,'x',5 ) with var = 23 returns '15<=x<25'

CELAMBARASAN
Partner - Champion
Partner - Champion

Try like this



LOAD

AccountCode               as  Account,
CustomerSName          as Customer,
NLControlAccount         as [NL Code],
CompanyKey;

SQL

SELECT
AccountCode,
CustomerSName,
NLControlAccount,
CompanyKey

FROM TAbleNAme Where NLControlAccount between 20000000000 and 400000000000;

its_anandrjs

You can also try with

LOAD

AccountCode               as  Account,
CustomerSName          as Customer,
NLControlAccount         as [NL Code],
CompanyKey;

SQL

SELECT
AccountCode,
CustomerSName,
NLControlAccount,
CompanyKey

From Location where NLControlAccount > 20000000000  and NLControlAccount < 400000000000;


And about your requirement write like


From Location where NLControlAccount > 300000000000  and NLControlAccount < 400000000000;