https://stackoverflow.com/questions/49705813/pentaho-excel-file-creation-with-file-name-from-field-or-other-variable
Not knowing what your existing solution does, or why, this is the best way I can think of solving your problem, given you want exactly the same data in a different file format:
Create a new job. In that job start a new transformation called 'get locations'
In this 'get locations' transformation as below, have two steps a) Table input, with a query like 'select distinct locations from data' and b) copy rows to result. This should give you a list of your unique locations
Create another new job called 'set variable and make excel'. This job will be run after your 'get locations' transformation, tick the 'execute once for every row' checkbox
In the new job, you'll have two transformations. set variable, and make excel.
The set variable transformation has two steps, first 'gets rows from results' then 'set variables'. In set variables, set a new variable called 'out_filename' equal to the field 'Location'
- In the 'make excel' transformation, you have two steps, table input, and microsoft excel output
- In the table input, run a query that uses your location variable (use the checkbox replace variables in script) eg. select * from data where Location = ${out_filename}
- In the 'microsoft excel output' make the filename c:\yourPath\${out_filename}
Run the main job, this should work.
Komentar
Posting Komentar
Silakan dikomen...