Automate

 View Only
  • 1.  Tranformation Rule

    Posted 05-13-2021 05:51

    Hello,

     I am creating a round trip scenario from a ZTABLE, when I created the query some of the fields were being downloaded as decimals even though decimal are not allowed as an input so the updates via transaction failed.

    After advice from Jay and some searching on the community I added a transform rule and all ran ok. The issue I have is that when I have published the query to excel and run it the decimals are not removed, can you help please, screen shots and query enclosed.

      Thanks 
    Rob



    ------------------------------
    Robert Preston | SAP Logistics
    Tenneco | +447921466774
    ------------------------------

    Attachment(s)

    Qsq
    ZCUST_PACK_INFO.Qsq   87 KB 1 version
    docx
    WS Transform.docx   88 KB 1 version


  • 2.  RE: Tranformation Rule

    Employee
    Posted 05-13-2021 09:46
    Hi Jay

    Please check the format of the columns you are trying to transform.  It's likely they have changed to number, which defaults to 2 decimal places - no matter what formula you apply. 

    I applied the same TRUNC formula to both column C and D.

    HTH
    Sigrid

    ------------------------------
    Sigrid Kok
    PSE | Winshuttle NA
    ------------------------------



  • 3.  RE: Tranformation Rule

    Posted 05-13-2021 09:57
    Hi,
    That was the point I was trying to make. I formatted the columns and saved and the data is ok but when you run the query again it overwrites them and makes them decimals again. Also, I do not understand why it works ok in the actual query but fails when its published to excel. 

    I really do not want the user to have to remember to format the columns to change the data after every extract.

    Thanks
    Rob

    ------------------------------
    Robert Preston | SAP Logistics
    Tenneco | +447921466774
    ------------------------------



  • 4.  RE: Tranformation Rule

    Posted 05-13-2021 10:04
    Sigrid - Tried to change the format to General, but it is overwriting to Number..

    Robert - Can you have another sheet in excel with the same fields where you can apply formula to remove zeros and the user can use that sheet. Not sure if this is a feasible solution. Will look for other replies too..

    ------------------------------
    Krishna
    ------------------------------



  • 5.  RE: Tranformation Rule

    Employee
    Posted 05-13-2021 10:25
    Hi Rob

    Got it.  So what you experience in Studio is not fully Excel - it's a 3rd party product, so there may be differences.  I was able to reproduce your issue, and no, I was not suggesting the runner reformat each time - I thought it would "stick", but it does not.

    Here's another approach I just tested - I'm using a standard table - MARA with gross and net weight, which is output with decimal points.

    Use an Excel Conditional Formatting rule - and remove your formulas in the Query mapper.

    I'm applying the Excel conditional formatting rule to all of column D and E  (you see the results of this rule in the excel part of this screen shot)
    If the value is not blank - when you first create the rule, Excel will add double quotes, so I had to go back in and ensure it was just "" not """"""

    format the number to have 0 decimal places

    I've tried this out in Excel, and it works after publishing the script.  

    Hope that this helps you out.

    Sigrid

    ------------------------------
    Sigrid Kok
    PSE | Winshuttle NA
    ------------------------------



  • 6.  RE: Tranformation Rule

    Employee
    Posted 05-13-2021 10:28
    Attaching example

    ------------------------------
    Sigrid Kok
    PSE | Winshuttle NA
    ------------------------------

    Attachment(s)

    xlsx
    Table_20210513_070325.xlsx   32 KB 1 version
    Qsq
    Table_20210513_070325.Qsq   195 KB 1 version


  • 7.  RE: Tranformation Rule

    Posted 05-13-2021 11:06
    Hi,
    Once again thanks for your help and support, i will give it a go.

    Regards
    Rob

    ------------------------------
    Robert Preston | SAP Logistics
    Tenneco | +447921466774
    ------------------------------