Announcements
MAINTENANCE ALERT: Dec. 12th starting 9 AM CET. Community will be read-only. GET DETAILS
cancel
Showing results for
Did you mean:
Not applicable

## create new field in the script - Cross table

Hi!

I have the following Table1 in my script:

Table1:

CrossTable(Month, Val, 1)

[1] as Jan,

[2] as Feb,

[3] as Mar,

[4] as Apr,

[5] as May,

[6] as Jun,

[7] as Jul,

[8] as Aug,

[9] as Sep,

[10] as Oct,

[11] as Nov,

[12] as Dec

FROM

xxxx

INDICATOR can have 4 possible values ('A','B','C','D'). All the other columns have numerical values.

I would like to add a new INDICATOR value called 'AB, which are the sum of the values where INDICATOR is 'A' or 'B'

Thank you!

1 Solution

Accepted Solutions
Specialist II

Table1:

CrossTable(Month, Val, 1)

//INDICATOR,

If(INDICATOR='A' or INDICATOR='B','AB',INDICATOR) as INDICATOR,

[1] as Jan,

[2] as Feb,

[3] as Mar,

[4] as Apr,

[5] as May,

[6] as Jun,

[7] as Jul,

[8] as Aug,

[9] as Sep,

[10] as Oct,

[11] as Nov,

[12] as Dec

FROM

xxxx

2 Replies
Specialist II

Table1:

CrossTable(Month, Val, 1)

//INDICATOR,

If(INDICATOR='A' or INDICATOR='B','AB',INDICATOR) as INDICATOR,

[1] as Jan,

[2] as Feb,

[3] as Mar,

[4] as Apr,

[5] as May,

[6] as Jun,

[7] as Jul,

[8] as Aug,

[9] as Sep,

[10] as Oct,

[11] as Nov,

[12] as Dec

FROM

xxxx

Not applicable
Author

Hi,

Table1:

CrossTable(Month, Val, 1)

If(INDICATOR='A' or INDICATOR='B','AB',INDICATOR) as INDICATOR,

[1] as Jan,

[2] as Feb,

[3] as Mar,

[4] as Apr,

[5] as May,

[6] as Jun,

[7] as Jul,

[8] as Aug,

[9] as Sep,

[10] as Oct,

[11] as Nov,

[12] as Dec

FROM

<Table_Name>;

i think it might help u.

Community Browser