Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
paulyeo11
Master
Master

How to modify script so that it can have min and max range control ?

Hi All

 

My script below :-

 

if(num(@124:129T)<'50099','4 CURRENT ASSET 0 - 50099',

if(num(@124:129T)<'70099','5 CURRENT LIABILITY 50100 - 70099',

)) as [NAME_],

it will filter

from 0-50099 as for Current Asset.

from 50100-70099 as for Current Liability.

My question is how to modify the above script so that it will  :-

from 50000-50099 as for Current Asset.

from 60100-70099 as for Current Liability.

Hope some one can advise me.

Paul

1 Solution

Accepted Solutions
Sokkorn
Master
Master

Ah... Paul. That is my mistake in script level .

Previous script

If(Num(@124:129T)>=50000 and Num(@124:129T)=<50099,'4 CURRENT ASSET 0 - 50099',

    If(Num(@124:129T)>=60100 and Num(@124:129T)=<70099,'5 CURRENT LIABILITY 60100 - 70099')) as [NAME_NEW],

Modified to

If(Num(@124:129T)>=50000 and Num(@124:129T)<=50099,'4 CURRENT ASSET 0 - 50099',

    If(Num(@124:129T)>=60100 and Num(@124:129T)<=70099,'5 CURRENT LIABILITY 60100 - 70099')) as [NAME_NEW],

Try it and take a look.

Rgds,

Sokkorn

View solution in original post

4 Replies
Sokkorn
Master
Master

Hi Paul,

I'm not sure you try this script yet

If(Num(@124:129T)>=50000 and Num(@124:129T)=<50099,'4 CURRENT ASSET 0 - 50099',

    If(Num(@124:129T)>=60100 and Num(@124:129T)=<70099,'5 CURRENT LIABILITY 60100 - 70099')) as [NAME_],

By the way, QlikView recognise filter value '50099' as a string. So to avoid conflict script translation, we should use it in number format(because you used Num(@124:129T) that one return in number format).

Regards,

Sokkorn

paulyeo11
Master
Master
Author

Hi Sokkom

Many thank for your script, I manage detect one error

If(Num(@124:129T)>=50000 and Num(@124:129T)=<50099,'4 CURRENT ASSET 0 - 50099',

    If(Num(@124:129T)>=60100 and Num(@124:129T)=<70099,'5 CURRENT LIABILITY 60100 - 70099'

need to add a , here

)) as [NAME_],

even i manage detect the error , i still get error. may be you can help me again ?

Paul

Sokkorn
Master
Master

Ah... Paul. That is my mistake in script level .

Previous script

If(Num(@124:129T)>=50000 and Num(@124:129T)=<50099,'4 CURRENT ASSET 0 - 50099',

    If(Num(@124:129T)>=60100 and Num(@124:129T)=<70099,'5 CURRENT LIABILITY 60100 - 70099')) as [NAME_NEW],

Modified to

If(Num(@124:129T)>=50000 and Num(@124:129T)<=50099,'4 CURRENT ASSET 0 - 50099',

    If(Num(@124:129T)>=60100 and Num(@124:129T)<=70099,'5 CURRENT LIABILITY 60100 - 70099')) as [NAME_NEW],

Try it and take a look.

Rgds,

Sokkorn

paulyeo11
Master
Master
Author

Hi Sokkom , it work fine now. Thank you