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
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;
Send me the sample please.
Why are you using concatenate?
Check the association too
Hi Use the Interval match
emp:
Load empno,
ename,
sal
From Location;
Table1:
Load * Inline [
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)
Load
min_Sal,
max_Sal
Resident Table1;
Try to use function INTERVALMATCH (Extended)
Hi Sanjeev,
Try like this
Data:
Load empno,
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.
i can't send data i.e i create sample for emp. but i need script part sujeet.
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.
Try using Class() in place of nested If.
Hi Sanjeev,
Try like this
Data:
Load empno,
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)
Load empno,
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.