Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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????
the above one only i tryed but when i select salary_band value in front end no data is displaying.
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;
Refer this sample please
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.
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
thanks for that replay it is working