Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

problem facing on salary_band?

Hi guys,

i have developed  qlikview application with loaded data like

emp:

Load empno,

         ename,

         sal

;

concatenate(emp)

Load empno,

         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:

Load empno,

         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)

Load empno,

         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:

Load empno,

         ename,

         sal

;

concatenate(emp)

Load empno,

         ename,

         sal

;

concatenate(emp)

load

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





16 Replies
Not applicable
Author

thanks for that replay jagan, but if my script is like that

emp:

Load empno,

         ename,

         sal

;

concatenate(emp)

Load empno,

         ename,

         sal

;

where can i place salary_band expression? in emp table part or concatenate(emp) part????

Not applicable
Author

the above one only i  tryed but when i select salary_band value  in front end no data is displaying.

sujeetsingh
Master III
Master III

Sanjeev ,

Then you need to fist concatenate then use the nested iff

emp:

Load empno,

         ename,

         sal

;

concatenate(emp)

Load empno,

         ename,

         sal

;

MainData:

Load *

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

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

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

resident emp;

drop table emp;

sujeetsingh
Master III
Master III

Refer this sample please

jagan
Luminary Alumni
Luminary Alumni

Hi Sanjeev,

Try like this

Temp:

Load empno,

         ename,

         sal

FROM DataSource1;

Concatenate(Temp)

Load empno,

         ename,

         sal

FROM DataSource2;

Data:

LOAD

*,

          if(sal > 100000, '100000+',

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

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

RESIDENT Temp;


DROP TABLE Temp;


If not working attach some sample data.

Hope this helps you.

Regards,

Jagan.

Not applicable
Author

Thanks jagan it is working but i create bar chart based on salary_band but according salary_band (sal is not changing) can you please look on that???

PLEASE FIND ATTACHED FILE

Not applicable
Author

thanks for that replay it is working