Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello everyone,
I have two tables (Care and Model) as I want to combine into a table
Table 1 (Car)
CarID Car
1 Volvo
2 Ford
Table 2 (Model)
CarID Model
1 V70
1 S40
1 XC60
2 C-max
2 Focus
The combined table should be so:
CarID Car Model
1 Volvo V70, S40, XC60
2 Ford C-max, Focus
How should I write the script for this?
Thanks in advance.
At scipt Level....
Cars:
Load * inline
[
CarID,Car
1,Volvo
2,Ford
];
Left Join(Cars)
Model:
Load * inline
[
CarID,Model
1,V70
1,S40
1,XC60
2,C-max
2,Focus
];
NoConcatenate
New_Table:
Load
CarID,
Car,
Concat(Model,',') as Model
Resident Cars
group by CarID,Car;
Drop table Cars;
Regards,
Pradeep
Instead of script, we can achieve this at Chart level also....
create a straight table and enable the 'NoTotal' option in expression tab
Dimensions: CarID, Car
Expression : =Concat(Model,',')
Regards
Pradeep
Many thanks Pradeep, I would like to fix it in the script to use "Model" in a straight table-object (not raktabell through chart-objects).
Best regards
Stravan
At scipt Level....
Cars:
Load * inline
[
CarID,Car
1,Volvo
2,Ford
];
Left Join(Cars)
Model:
Load * inline
[
CarID,Model
1,V70
1,S40
1,XC60
2,C-max
2,Focus
];
NoConcatenate
New_Table:
Load
CarID,
Car,
Concat(Model,',') as Model
Resident Cars
group by CarID,Car;
Drop table Cars;
Regards,
Pradeep
this is the script
but I would keep the 2 tables and, when you need it, concat in chart
Table1:
load * inline [
CarID , Car
1 , Volvo
2 , Ford
];
Left join (Table1)
load CarID, concat(Model, ', ') as Model group by CarID;
load * inline [
CarID , Model
1 , V70
1 , S40
1 , XC60
2 , C-max
2 , Focus
];
It was good, thank you very much.
Best regard
Stravan