Hitachi Vantara Pentaho Community Forums
Results 1 to 3 of 3

Thread: Microsoft Excel Writer - filename is from previous step

  1. #1
    Join Date
    Jun 2016
    Posts
    181

    Default Microsoft Excel Writer - filename is from previous step

    Hi,

    I have transformation:

    Table-Input => Sort-Rows => Get-Variables => Formula => Text-File-Output

    (Get-Variables takes ${Internal.Entry.Current.Directory} and Formula create field "FullDataFile" (directory_name+filename) ...part of filename is date. Text-File-Output use field "FullDataFile" as filename so transformation creates files like 103_2011212.txt... 104_2011212.txt...105_2011212.txt with subset of data)


    It works.
    But I want to produce Excel format as output.

    I think I cannot use Microsoft-Excel-Writer in same transformation since for some reason I cannot set and read variables in same transformation. So I probably need job:

    Start => transformation[Table-Input => Sort-Rows => Get-Variables => Formula => Text-File-Output =>Copy-Rows-To-Result] => Job or Transformation that will save to Excel

    It works but creates just one file - "FullDataFile" will always contain last row value....

    How can I deal with this?
    Regards

  2. #2
    Join Date
    Jun 2016
    Posts
    181

    Default

    I modified the transformation to:


    Table-Input => Sort-Rows => Get-Variables => Formula => Modified Java Script Value => Text-File-Output


    with code:
    var strVarName="FullDataFile";
    var strVarValue=FullDataFile;
    setVariable(strVarName,strVarValue, "r");


    And it works partialy - FullDataFile keeps just one value. Should I destoy variable in some way each pass and create new one?

  3. #3
    Join Date
    Jun 2016
    Posts
    181

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.