# QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
cancel
Showing results for
Did you mean:
Not applicable

## problem facing on salary_band?

Hi guys,

i have developed  qlikview application with loaded data like

emp:

ename,

sal

;

concatenate(emp)

ename,

sal

;

here i need to create in script part salary band for emp

sal_band like(0 to 1000,1000 to 20000,20000 to 100000,100000+)

i have tryed in two ways like

1)

emp:

ename,

sal,

if(sal<=1000,'0-1000',

if(sal>1000 and sal<=20000,'1000-20000',

if(sal>20000 and sal<=100000,'20000-100000','100000+))) as sal_brand

;

concatenate(emp)

ename,

sal,

sal,

if(sal<=1000,'0-1000',

if(sal>1000 and sal<=20000,'1000-20000',

if(sal>20000 and sal<=100000,'20000-100000','100000+))) as sal_brand

;if i relode above sal_brand is creted but no data is getting .the above script is correct or wrong?

on more i tryed

2)

emp:

ename,

sal

;

concatenate(emp)

ename,

sal

;

concatenate(emp)

if(sal<=1000,'0-1000',

if(sal>1000 and sal<=20000,'1000-20000',

if(sal>20000 and sal<=100000,'20000-100000','100000+))) as sal_brand

;

if i relode sal_brand is creating but no data coming .

can you please suggest me how can i proceed with this ??

Best regards,

sanjeev

1 Solution

Accepted Solutions
Master III

Sanjeev ,

Then you need to fist concatenate then use the nested iff

emp:

ename,

sal

;

concatenate(emp)

ename,

sal

;

MainData:

,if(sal > 100000, '100000+',

if(sal > 20000, '20000-100000',

if(sal >= 1000, '1000-20000', '0-1000'))) as sal_brand

resident emp;

drop table emp;

16 Replies
Master III

Why are you using concatenate?

Check the association too

Specialist

Hi Use the Interval match

emp:

ename,

sal

From Location;

Table1:

min_Sal,max_Sal,Salrange

0,10000,'0 to 10000'

10001,20000,'10K to 20 K'

20001,30000,'20K to 30K'

30001,,'>30 K'

];

BridgeTable:

interval Match(sal)

min_Sal,

max_Sal

Resident Table1;

Master II

Try to use function INTERVALMATCH (Extended)

Luminary Alumni

Hi Sanjeev,

Try like this

Data:

ename,

sal,

if(sal > 100000, '100000+',

if(sal > 20000, '20000-100000',

if(sal >= 1000, '1000-20000', '0-1000'))) as sal_brand

FROM DataSource;

Hope this helps you.

Regards,

Jagan.

Master II
Not applicable
Author

i can't send data  i.e i create sample for emp. but i need script part sujeet.

Not applicable
Author

thanks for that sreekanth,but i am asking question if sal table is there and one more table am going to concatenate with same data at that time where can i write salary _band? like above in my script  i need diemention for salary_band not intevels.

Master III

Try using Class() in place of nested If.

Luminary Alumni

Hi Sanjeev,

Try like this

Data:

ename,

sal,

if(sal > 100000, '100000+',

if(sal > 20000, '20000-100000',

if(sal >= 1000, '1000-20000', '0-1000'))) as sal_brand

FROM DataSource1;

Concatenate(Data)

ename,

sal,

if(sal > 100000, '100000+',

if(sal > 20000, '20000-100000',

if(sal >= 1000, '1000-20000', '0-1000'))) as sal_brand

FROM DataSource2;

Hope this helps you.

Regards,

Jagan.