Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Experts,
I'm wondering if there's possible to create a column in pivot table?
The format is like below, Month is as the dimension in the pivot table, and I would like to create extra column called 'MoM'.
Is there any way to make this happen?
Item | Jan | Feb | Mar | MoM |
---|---|---|---|---|
A | 100 | 110 | 90 | -20 |
B | 150 | 160 | 130 | -30 |
C | 80 | 90 | 60 | -30 |
D | 50 | 60 | 100 | 40 |
Thanks a lot
Hi,
try like this
Dim:
Item
ValueList('Jan','Feb','Mar','MoM')
Expression
if(ValueList('Jan','Feb','Mar','MoM')<>'MoM',sum({$<Month={'Mar'}>}Amt),sum({$<Month={'Mar'}>}Amt)-sum({$<Month={'Feb'}>}Amt))
P.S: based on you Calendar data you can change the Month/Date value in above expression.
Thanks,Deva
Hello, Kate!
You can also use Pick() function, but first you need to improve your script with wthis load:
Load * inline
[dim
1
2];
after that create a pivot table with two dimensions:
Item
and
Pick(dim,month_field,'MoM')
As expression use this:
Pick(dim,sum(val),sum({<cur_month>}val)-sum({<prev_month>}val))
hi
as per your requirement and if i understood it correctly you want to create a dynamic/extra column that will show the subtraction of two column march and feb in this case which can be pre populated or else calculated
1:create column MOM
2: in expression type column name1 within [ ] - column name 2 within [ ]
something like [column1]-[column2] or [Mar] - [Feb]
share the app if it doesn't work for you.
regards
Pradosh
Hi Devarasu,
Thanks for your reply.
What if there is more than three months, is it possible to use the field name like "Month" instead of individual month (such as Jan, Feb, and Mar)?
Thanks