Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
kylealpaugh
Contributor
Contributor

Add Month Column

I have a table with year targets I need to make them by Period 1-12

The table currently has 3 fields customer material and target 

Customer Material Target 

1A                     BBX          120

1B                     BVF           240

 

I want to be able to add a column for period and divide each of the targets by 12to look like 

Customer  Material   Target Period

1A                      BBX         10          1

1A                       BBX        10           2

 

Is this possible to do in the script I cant find a way to do it 

 

1 Solution

Accepted Solutions
QFabian
Specialist III
Specialist III

Hi @kylealpaugh , very fun script, please check if it works for you :

A:
LOAD * INLINE [
Customer, Material, Target
1A, BBX, 120
1B , BVF,240
];


left join
LOAD * INLINE [
Month
1
2
3
4
5
6
7
8
9
10
11
12
];

 

B:
Load
Customer,
Material,
Target,
Target / 12 as TargetMonth,
Month


Resident A;
drop table A;

QFabian

View solution in original post

2 Replies
QFabian
Specialist III
Specialist III

Hi @kylealpaugh , very fun script, please check if it works for you :

A:
LOAD * INLINE [
Customer, Material, Target
1A, BBX, 120
1B , BVF,240
];


left join
LOAD * INLINE [
Month
1
2
3
4
5
6
7
8
9
10
11
12
];

 

B:
Load
Customer,
Material,
Target,
Target / 12 as TargetMonth,
Month


Resident A;
drop table A;

QFabian
kylealpaugh
Contributor
Contributor
Author

Thanks it worked