Skip to main content
I would like to collect data every week and save one weeks data to column. How can I save data from week 1 to column 1, week 2 to column 2 etc? I have tried to set 'Start Column' as $(xlsx_start_col), but that does not work. I also tried to use $(xlsx_start_col) as 'Use Attribute Names As Column Positions, but but didn't work also.
Have you used a column number instead of a letter?
Hi,

 

 

I think Own is right, these settings inserted a value into cell B2 using FME 2014 SP1:

 

 

 

 

Note that column and row numbers start at 1, not 0.

 

 

David
Thanks for your answers, but problem is not yet solved. This is what I am trying to do:

 

 

1st I get number of week:

 

 

 

Then I add it to XLSX writer feature type properties as Start Column:

 

 

 

So feature type properties look like this

 

 

 

That does not work, because default value is used. xlsx_start_col has values.
Hi,

 

 

that isn't possible, I'm afraid. User parameters are locked once you start your workspace, they cannot be modified at runtime, like you can with feature attributes.

 

 

You should consider using a Python scripted parameter instead, they are interpreted before the translation starts. This script will return the week number for you (just like the TimeStamper) and you can use it in the Excel writer:

 

 

---

 

import datetime

 

return datetime.date.today().isocalendar()l1]

 

---

 

 

David
Thanks David! I hope it is not too much to ask if you could show whole Python Script and what I have to add to PythonCaller Parameters, because there was so much red at log. Only thing I have done with Python is that I have used mr Takashi's code last week with FME. I guess I need take some Python Script course for newbies.
Hi,

 

 

scripted parameters are very powerful, but perhaps not very well documented. But there are several articles here on FMEpedia to help you along.

 

 

Here's how you can implement it:

 

 

 

 

In the output feature type:

 

 

 

 

Hope this helps.

 

 

David
That sure helps! Now I get data where I want it. Thank you! I hope I manage to do next Python script coding by myself 🙂

Reply