Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I have a field : (Years + Quarter)
I have 2 questions:
1)how can I add a string in the middle of an integer
Example :(2018 3) to (2018 Q3).
2) How can i split the field to 2 parts
Example: (2018 3) to Year:(2018) Quarter:(3)
for question 1 :
left(Field,4)&' Q'&right(Field,1)
for question2:
'Year:('&left(Field,4)&') Quarter:('&right(Field,1)&')'
for example :
Data:
load *, left(Field,4)&' Q'&right(Field,1) as Question1, 'Year:('&left(Field,4)&') Quarter:('&right(Field,1)&')' as Question2 inline [
Field
2018 1
2018 2
2018 3
2018 4
];
ouput:
@Alarkis like ?
'Year:('&left(Field,4)&')'
and for quarter
'Quarter:('&right(Field,1)&')'
example :
Data:
load *, left(Field,4)&' Q'&right(Field,1) as Question1, 'Year:('&left(Field,4)&')' as Year, 'Quarter:('&right(Field,1)&')' as Quarter inline [
Field
2018 1
2018 2
2018 3
2018 4
];
output:
for question 1 :
left(Field,4)&' Q'&right(Field,1)
for question2:
'Year:('&left(Field,4)&') Quarter:('&right(Field,1)&')'
for example :
Data:
load *, left(Field,4)&' Q'&right(Field,1) as Question1, 'Year:('&left(Field,4)&') Quarter:('&right(Field,1)&')' as Question2 inline [
Field
2018 1
2018 2
2018 3
2018 4
];
ouput:
Thanks for the reply.
For question 2 i mean Year is separate field and Quarter is separate field
@Alarkis like ?
'Year:('&left(Field,4)&')'
and for quarter
'Quarter:('&right(Field,1)&')'
example :
Data:
load *, left(Field,4)&' Q'&right(Field,1) as Question1, 'Year:('&left(Field,4)&')' as Year, 'Quarter:('&right(Field,1)&')' as Quarter inline [
Field
2018 1
2018 2
2018 3
2018 4
];
output: