Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a sales table consisting of following fields
Date
Dept (AA,BB,CC,DD,EE,AB,AC)
Product
Sales Person
Amount
In the load script I want to merged two dept into one.
sales:
LOAD Date,
if(Dept='AB','AA',if(Dept='AC'='CC'))as Dept, //( AA+AB as one and AC and CC as one dept)
Product,
Sales Person,
Amount
from sales.qvd
(qvd);
After the load I want to Dept dimension to consists of following Dept only.
AA,BB,CC,DD but not the AB and AC
But in my output I get only AA and CC as dept.
Pls help me to solve this problem
Hi. if you want to merge the AB to AA, and AC to CC, and the other to the same:
if(Dept='AB',
'AA',
if(Dept='AC',
'CC',
Dept)) as Dept
TRY THIS
if(wildmatch( Dept,'AA','BB','CC','DD','EE'),Dept) as Dept
hope it helps
Hi Upali,
You can do like this:
sales:
LOAD Date,
if(Dept='AB','AA',if(Dept='AC'='CC'))as Dept, //( AA+AB as one and AC and CC as one dept)
Product,
Sales Person,
Amount
from sales.qvd
(qvd)
Where Dept<>AB and Dept<>AC;
Thanks,
AS
Thanks
But It is not working as expected by. It does not show any dimension at all.
Hi. if you want to merge the AB to AA, and AC to CC, and the other to the same:
if(Dept='AB',
'AA',
if(Dept='AC',
'CC',
Dept)) as Dept
Hi Upali,
Could you please share your data.
Thanks,
AS
if(match(Dept,'AB','AA'),'AA',if(match(Dept,'AC','CC'),'CC',Dept)) as Dept2
Thanks a lot