HI team, I am looking to add new calculated column after cross tab output. Here i have 2 dates data to compare. These dates are dynamic hence i can't directly use the formula tool.
Cross tab output column: IB, Cust ID, 20201015,20201231.
expected calculated field: difference between underlying data in 2001015 and 20201231
ID | cust ID | 20201015 | 20201231 | calculated field |
1 | ABS | 25 | 21 | =21-25 |
2 | CFH | 84 | 96 | =96-84 |
3 | KKM | 25 | 35 | =35-25 |
Hi @AnkitDwivedi6,
Probably there might be a better solution for this but this one definitely works
The output is:
Does it matter what the date columns that come out of the cross tab are named? Would it be okay if they're named just "Date1" and "Date2", or something else generic like that? If so, there's be a pretty easy solution.
Hi thanks for reply. Yes i need dates as well to infer more information from the data set.
if we can name "latest date" and "previous date" that can help?
Hi @AnkitDwivedi6,
In that case, my answer should work for you.
One upside in it should work fast as I am just changing the names of the columns.
If you are interested in only working on 2 columns it should work perfectly.
In that case I'd go with a dynamic rename:
Step 1: Create a text input tool with the column names you'll ultimately want:
Step 2: Connect to cross tab output with a Dynamic Rename tool and rename as follows:
Step 3: Create your formula: