Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
I am trying to get my field name to display Wk01 in the example below as the current week. This is a forecast model so the weeks should update automatically when the file is accessed.
Instead of having Week01Qty, I want to see Week 33 Qty - if current week is week 33.
I hope someone can assist with this.
Thanks
Soreen
if
(ContractBalance.WeeksRemaining>=1,ContractBalance.WeeklyQty,0) AS Week01Qty, //to display as Week(Current) & 'Qty'//
if
(ContractBalance.WeeksRemaining>=2,ContractBalance.WeeklyQty,0) AS Week02Qty, //to display as Week(Current)+1 & 'Qty'//
if(ContractBalance.WeeksRemaining>=3,ContractBalance.WeeklyQty,0) AS Week03Qty, //to display as Week(Current)+2 & 'Qty'//
if
Sorry Soren I don't understand what you are looking for. Can you explain more?
Andrea
It is possible to handle through using variables in a loop
Table:
LOAD * INLINE [
<just a name of at least one field in the table, no any data>
];
FOR W = 1 to 53
CONCATNATE (Table)
LOAD
...
<expression> as Week$(W)Qty,
...
RESIDENT...
WHERE week(<some date field>) = $(W);
NEXT
Hi
Are you sure that creating new field(s) for each week number is what you want to do? That could result in a very cumbersome data model and you would probably have to modify the expressions each week to keep in synch with the fields.
I appreciate that you might have a compelling reason for this design, but the normal approach would be to have Qty field and a date field (which could be a week number field) in the transaction table.
Jonathan