Qlik Community

New to Qlik Community

Discussion board for questions on how to use Qlik Community and its features.

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
Honored Contributor III

Re: Ranges in script

aFTER LOADING JUST WRITE THE NESTED IFF STATEMENT

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

IF(----

sujeetsingh
Honored Contributor III

Re: Ranges in script

sEE THIS Range function

sujeetsingh
Honored Contributor III

Re: Ranges in script

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'

Re: Ranges in script

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;

Re: Ranges in script

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;

                                                                    



Community Browser