Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
i need to add an additional column with static value. i loaded data from excel by using ETS
The wizard helps you do a conditional copy of data from other columns.
If it is a static value, u should write it on your script directly.
This my script. can you help me how i add a additional column ?
CrossTable(Name, Quantity, 3)
LOAD *
FROM
[Barisal.xls]
(biff, embedded labels, table is Sheet1$, filters(
Remove(Col, Pos(Top, 1))
));
CrossTable(Name, Quantity, 3)
LOAD *,
'Static_Value' as Static_field
FROM
[Barisal.xls]
(biff, embedded labels, table is Sheet1$, filters(
Remove(Col, Pos(Top, 1))
));
you can directly add the static field as shown above, if it is a numeric value single quotes is not mandatory.
Regards,
sundar
CrossTable(Name, Quantity, 3)
LOAD *,
'Value' as Field_Name
FROM
[Barisal.xls]
(biff, embedded labels, table is Sheet1$, filters(
Remove(Col, Pos(Top, 1))
));
Hi Yakub,
You can create flag for assigning static value as below
CrossTable(Name, Quantity, 3)
LOAD *,
'Value' as Static_field
FROM
[Barisal.xls]
(biff, embedded labels, table is Sheet1$, filters(
Remove(Col, Pos(Top, 1))
));
Thanks both but not working this script....
Pls share a sample.
Hi,
Try this,
ABC:
CrossTable(Name, Quantity, 3)
LOAD *
FROM
[Barisal.xls]
(biff, embedded labels, table is Sheet1$, filters(
Remove(Col, Pos(Top, 1))
));
ABC1:
Load *,'Value' as New_Field Resident ABC;
Drop table ABC;
Regards,
Kaushik Solanki
Try
Data:
CrossTable(Name, Quantity, 3)
LOAD *
FROM
[Barisal.xls]
(biff, embedded labels, table is Sheet1$, filters(
Remove(Col, Pos(Top, 1))
));
New:
noconcatenate
load *,
'Static_Value' as Flag
resident Data;
drop table Data;