Amount from 2 different columns. import format?

Hi all,
Im trying to import amounts from 2 different columns. If accounts are "123" or "234" or...etc
Then pull from column
else use column 9
can this be done in one import script? I want to know if I can assign import format amount to column 5 but only get the accounts asked for. else use column 9.

I made something like this, and assigned it to an amount column with all the amounts. Does it make sense?
Function This_Code (strField, strRecord)
Dim Account
Dim Ammount
'Field instead of strRecord
account = DW.Utilities.fParseString(strField, 12, 5, ",")
Amount = DW.Utilities.fParseString(strField, 12, 11, ",")
If Account = "123" or Account = "456" Then
Amount = This_Code
End If
Edited by: tyson33 on Jun 28, 2012 10:11 AM

Similar Messages

  • Sales Amount from one column of period (FY-2012, FY-2013) to 2 different columns

    Hi dudes,
    I'm having some difficulties in getting the Sales Amount  from one column of period (Fiscal Year containing 2012 and 2013) and put it into 2 different columns (Sales 2012 and Sales 2013. I have 3 fields in my dataset: Sales (for all the years), Fiscal
    Year (more than 5 years) and month (which I can neglect).
    For the moment, my situation is as follows:
    Fiscal Year          Month       
    2012                      Jan           $72,500
                                   Feb          $80,200
                                   Dec          $79,500
    2013                      Jan           $51,000
                                   Feb          $62,800
                                   Dec          $85,000
    However I would like to get a scenario as follows:
    Sales 2012          Sales 2013
         Jan              $72,500                  $51,000
         Feb             $80,200                   $62,800
         Dec             $79,500                   $85,000
    Once I have this, I would be much easier for me to do the difference between the two sales period.
    Is there any expression I can use?
    I tried to filter from the Group properties the sales amount for Fiscal Year 2012 on 1 column, and on on another column, the sales amount for Fiscal Year 2013 but it is giving me the same values.
    Thank you very much dudes.

    Hi Stan,
    According to your description, we can use a matrix control to achieve your requirement. For more details, please refer to the following steps:
    Drag a matrix from Toolbox to design surface.
    Insert Month field to the first column.
    Insert Fiscal_Year field to the first row of the second column.
    Insert Sales field to the second row of the second column.
    Right-click the second column to add a column with Outside Group-Right option.
    Type the expression below to the second row of the third column:
    The following screenshot id for your reference:
    If there are any other questions, please feel free to ask.
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Distinct data from different columns of a table-Single query

    I have a table with different columns. Each of these columns have entries. A particular column, say, a column called name can have same entries more than one time. Likewise other columns can also have same entries more than once. My requirement is to have distinct entries from each of these columns using a single query, such that , for eg; the name column will contain the name George only once on retrieval. Place column will have the place Newyork only that...but Newyork and newyork should be treated different(likewise in other columns also ie; case sensitive). I want to retrieve the above said using a single query from a table. Kindly help.

    You're asking a SQL question in a JDBC forum. Look for a SQL forum. The website of the database manfactuer may have a SQL forum/mailinglist.

  • How to total amounts from different categories using pop-up menus?

    I am working on personal financing using Numbers for the first time. I have formated the "Category" cells in the "Transactions" table to be pop-up. Meaning ... I click on the cell and select the appropriate category (Bills, loans, grocery, eating out, etc.) How do I get the amount that I've entered for certain categories to populate into the "Acount Categories" table? Ex -- Moving $1.06 from the "Transactions" table to the "Account Categories" table. Eventually, there will be multiple entries for each category and I want a total to show up in the upper table which I have already formated to turn into a pie chart. Thanks.

    Hi smessen,
    The formula in cell B2 of Account categories was originally: =SUMIF(Transactions :: $D,A2,Transactions :: E)
    You have apparently deleted column A of Transactions, so the formula needs revision to accomodate that change.
    Account Categories::B2: =SUMIF(Transactions :: $C,A2,Transactions :: D)
    Fill the formula down to B9.
    Items in the list in column A of Account Categories must exactly match those in the list in the pop-up menu cells in column C of Transactions. Remember to include "Deposit" in the menus to mark an amount that will not be included in the Account Categories table. You can also include a menu item such as "Choose", "-" or " " (single space) to use as the default value for unused rows.

  • Getting 2nd Least Value from Different Column

    Hi there All,
    I have one odd requirement.
    I hava table which has diffrent columns of numeric Datatype.
    The task is to get the least values from the table.
    I can take the least value by least(col1,col2,col3 ...) function.Until this stage it is fine.
    But also I have take 2nd least value and 3rd least value, which I am quite unsure how to get it.
    Looking forward for suggestions.
    Thanks in Advance.

    The following is a generic solution that will allow you to select the nth least and allow you to pass as many column names as you like and will return null if the nth least requested exceeds the number of distinct values. The nleast function that I wrote uses the str2tbl function by Tom Kyte. I have included a demonstration of its usage below. The value returned for the 1st least is the same as that returned by the least function.
    This should have been posted on the SQL and PL/SQL discussion group of these forums, rather than the general database. I also posted the same response in the SQL discussion group of the Orafaq forums.
    [email protected]> -- test data:
    [email protected]> SELECT * FROM your_table
      2  /
          COL1       COL2       COL3
             1          2          3
             4          6          5
             8          7          9
            11         12         10
            15         13         14
            18         17         16
    6 rows selected.
    [email protected]> -- type and functions:
    [email protected]> create or replace type myTableType as table of number;
      2  /
    Type created.
    [email protected]> create or replace function str2tbl( p_str in varchar2 )
      2  return myTableType
      3  as
      4        l_str      long default p_str || ',';
      5        l_n         number;
      6        l_data    myTableType := myTabletype();
      7  begin
      8        loop
      9            l_n := instr( l_str, ',' );
    10            exit when (nvl(l_n,0) = 0);
    11            l_data.extend;
    12            l_data( l_data.count ) := ltrim(rtrim(substr(l_str,1,l_n-1)));
    13            l_str := substr( l_str, l_n+1 );
    14        end loop;
    15        return l_data;
    16  end;
    17  /
    Function created.
    [email protected]> CREATE OR REPLACE FUNCTION nleast
      2    (p_n        IN NUMBER,
      3       p_nums        IN VARCHAR2)
      4    RETURN           NUMBER
      5  AS
      6    v_nleast      NUMBER;
      7  BEGIN
      8    SELECT DISTINCT column_value
      9    INTO   v_nleast
    10    FROM   (SELECT column_value,
    11                  DENSE_RANK () OVER (ORDER BY column_value) AS num_rk
    12              FROM   (select *
    13                   from   table (CAST (str2tbl (p_nums) AS mytabletype)))
    14             WHERE   column_value IS NOT NULL)
    15    WHERE  num_rk = p_n;
    16    RETURN v_nleast;
    19  END nleast;
    20  /
    Function created.
    [email protected]> SHOW ERRORS
    No errors.
    [email protected]> -- query:
    [email protected]> SELECT col1, col2, col3,
      2           LEAST (col1, col2, col3) AS the_least,
      3           nleast (1, col1 || ',' || col2 || ',' || col3) AS first_least,
      4           nleast (2, col1 || ',' || col2 || ',' || col3) AS second_least,
      5           nleast (3, col1 || ',' || col2 || ',' || col3) AS third_least,
      6           nleast (4, col1 || ',' || col2 || ',' || col3) AS fourth_least
      7  FROM   your_table
      8  /
             1          2          3          1           1            2           3
             4          6          5          4           4            5           6
             8          7          9          7           7            8           9
            11         12         10         10          10           11          12
            15         13         14         13          13           14          15
            18         17         16         16          16           17          18
    6 rows selected.

  • Count of rows from different Columns

    SELECT (SELECT COUNT (empno) empno
              FROM emp) empno, (SELECT COUNT (mgr) mgr
                                  FROM emp) mgr, (SELECT COUNT (sal) sal
                                                    FROM emp
                                                   WHERE sal > 2000) sal
      FROM DUAL;Hi friends
    Please let me know any better solutions for this query..??

    user10594152 wrote:
    Please let me know any better solutions for this query..??Why not just..
    SQL> select * from emp;
         EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM     DEPTNO
          7369 SMITH      CLERK           7902 17-DEC-80        800                    20
          7499 ALLEN      SALESMAN        7698 20-FEB-81       1600        300         30
          7521 WARD       SALESMAN        7698 22-FEB-81       1250        500         30
          7566 JONES      MANAGER         7839 02-APR-81       2975                    20
          7654 MARTIN     SALESMAN        7698 28-SEP-81       1250       1400         30
          7698 BLAKE      MANAGER         7839 01-MAY-81       2850                    30
          7782 CLARK      MANAGER         7839 09-JUN-81       2450                    10
          7788 SCOTT      ANALYST         7566 19-APR-87       3000                    20
          7839 KING       PRESIDENT            17-NOV-81       5000                    10
          7844 TURNER     SALESMAN        7698 08-SEP-81       1500          0         30
          7876 ADAMS      CLERK           7788 23-MAY-87       1100                    20
          7900 JAMES      CLERK           7698 03-DEC-81        950                    30
          7902 FORD       ANALYST         7566 03-DEC-81       3000                    20
          7934 MILLER     CLERK           7782 23-JAN-82       1300                    10
    14 rows selected.
    SQL> ed
    Wrote file afiedt.buf
      1  select count(empno) as emps
      2       , count(mgr) as mgrs
      3       , sum(case when sal > 2000 then 1 else 0 end) as sals
      4* from emp
    SQL> /
          EMPS       MGRS       SALS
            14         13          6

  • Removing specific cells from different columns.

    Hi friends,
    My requirement is somewhat peculiar. I dont know anyone have already implemented that.
    I have 4 columns, 11 rows in my JTable.
    Now i want to display all the 11 rows (i.e to be specific cells ) for first two columns, and just 8 for the next two columns..
    Kind of incomplete table. Does anyone have any idea? please help me... This may be weird , but i need it.

    try this with some change to suit you
    written a renderer to remove a cell, hope this is what you need.
    public class CellRemoveRenderer implements TableCellRenderer {
         private JLabel label;
         DefaultTableCellRenderer defaultRenderer = new DefaultTableCellRenderer();
         public Component getTableCellRendererComponent(JTable table, Object value,
                   boolean isSelected, boolean hasFocus, int row, int column) {
              if (row == table.getRowCount() - 1) {
                   return label;
              } else {
                   return defaultRenderer.getTableCellRendererComponent(table, value,
                             isSelected, hasFocus, row, column);
    }apply this to table
    table.getColumnModel().getColumn(table.getColumnCount() - 1)
                        .setCellRenderer(new CellRemoveRenderer());i hope this ends your problem.

  • Compare dates in a different columns

    Hi All,
    How to get the largest date out from different columns.
    here is my query....
    select * from
    (select date1 from table1) a,
    (select date2 from table2) b,
    (select date3 from table3) c
    I want to get the largest date among date1, date2 and date3
    thank you in advance

    I think the following query helps to you.....

  • Import format for two amount columns in different currencies

    I am working on FDM and will be getting the trial balance containing amounts in two currencies (both local and USD). I need to load data in both the currencies. The extract has two columns for the amount rather than having two different rows for different currencies. Any ideas how to define this format and how to load data. We are not using the translation logic and hence the amounts in both currencies are required.
    Thanks for your help in advance.

    Hi Tony,
    Thanks a lot for the input. Any idea, how should I go about doing this else if you have any documentation, let me know. Also, what are the cons of doing it this way over requesting the customer to get the file with amounts in different rows than in different columns

  • Import Format for Separte Debit and Credit Columns (comma delimited file)

    I have a file that is comma delimited with a sparate debit column and a separate credit column:
    ,110010,another test,,100
    My import format is this:
    Comma delimited
    Field Number Number of Fields Expression
    Entity 1 5 SGB_ABC
    Account 2 5
    Amount 5 5 Script=DRCRSplit_Comma_Del.uss
    I've tried writing the following script to pull the amount from the debit column into the credit column but it just skips the lines with no amount in field 5.
    'Declare Variables
    Dim Field4
    Dim Field5
    'Retrieve Data
    Field4 = DW.Utilities.fParseString(strRecord, 4, 4, ",")
    Field5 = DW.Utilities.fParseString(strRecord, 5, 5, ",")
    'If Field4 has a value then fld 5 is to equal fld 4.
    If IsNumeric(Field5) Then
    Field5 = Field5
    Field5 = Field4
    End If
    'Return Result into FDM
    SQFLD5 = Field5
    End Function
    Can anyone tell me what I am doing wrong?

    I got it to work using this script:
    Function DRCR_Comma_Del(strField, strRecord)
    'Hyperion FDM DataPump Import Script:
    'Created By:     testuser
    'Date Created:     7/22/2009 9:31:15 AM
    'Purpose: If Amount is in the DR column move it to the CR amount column.
    Dim DR
    Dim CR
    DR = DW.Utilities.fParseString(strRecord, 5, 4, ",")
    CR = DW.Utilities.fParseString(strRecord, 5, 5, ",")
    If IsNumeric(DR) Then
    strField = DR
    strField = "-" & CR
    End If
    DRCR_Comma_Del = strField
    End Function

  • FDM Import Format Spec with multiple Amount Fields

    I'm in the process of setting up an Import specification for one of our sites and the source extract consists of the following fields:
    Source Account Description BegBalDR BegBalCr YTDDR YTDCR
    01-511-5110     Inventory Adjustment     1,754.00     0     0     14,844.76
    I'm am trying to Import Field 5 & 6 and net them if necessary (example: YTDDR - YTDCR) and I continue to get an error. I have tried several diffrent ways but it seems that I can only import one or the other. After reading the FDM Admin guide I am wondering if I need to create a custom Script to accomplish this task.
    Any advice would be appreciated.
    Thank you,

    This might be slightly complicated, but I think its the most direct solution ........
    Step 1 -
    In your Import Format, assign the Amount as :
    FieldName, Start, Length, Expression
    Amount, 1, 1, Script=NetAmounts5and6.uss
    Step 2 -
    Create an Import (DataPump) script called NetAmounts5and6 with the following code :
    Function NetAmount5and6(strField, strRecord)
    'Hyperion FDM DataPump Import Script:
    'Created By:     cbeyer
    'Date Created:     2/13/2009 5:57:14 PM
    'Get the last two fields
    Dim tmpRecord
    Dim strCurrentChar
    Dim strYTDCR
    Dim strYTDDR
    Dim x
    'Initialize fields
    tmpRecord = strRecord
    'Ensure we have data
    If Trim(tmpRecord) = "" Then Exit Function
    strYTDCR = ""
    strYTDDR = ""
    'Get YTD CR
    'One could use the replace command to change all spaces to a delimittable field and then
    'split out the string into a one dimensional array using the split command; however,
    'This would only work best if there is an exact number of spaces between the two numbers
    'Since I do not know if this is true, instead i'm looking for numeric/numeric like characters
    'and splitting based off of that.
    For x = Len(tmpRecord) To 1 Step -1
    strCurrentChar = Mid(tmpRecord,x,1)
    If (IsNumeric(strCurrentChar) Or strCurrentChar = "$" Or strCurrentChar = "." Or strCurrentChar = "," ) Then
    strYTDCR = strCurrentChar & strYTDCR
    Exit For
    End If
    'Trim down temporary record holder to remove the previous found amount and white space at the end of the string
    tmpRecord = RTrim(Left(tmpRecord,x)) 'Remove the first number from the string and white space
    'Get YTD DR
    For x = Len(tmpRecord) To 1 Step -1
    strCurrentChar = Mid(tmpRecord,x,1)
    If (IsNumeric(strCurrentChar) Or strCurrentChar = "$" Or strCurrentChar = "." Or strCurrentChar = "," ) Then
    strYTDDR = strCurrentChar & strYTDDR
    Exit For
    End If
    'do the math
    If IsNumeric(strYTDCR) And IsNumeric(strYTDDR) Then
    NetAmount5and6 = strYTDDR - strYTDCR
    NetAmount5and6 = 0 'This will cause the record to fail on import
    End If
    End Function

  • How To UPLOAD a DATA (.DAT) fiel from PC to internal table and then split it into the data different columns

    Hi all,
    I am new to ABAP Development. I need to upload a .DAT file (the file doesn#t have any proper structure-- Please find the .DAT file in the attachment). After uploading the DATA (.DAT) fiel I need to split in into different columns. Refering the attached .DAT fiel the fields in bracets like:
    [Arbeitstag],  [Pecunia], [Mita], [Kunde], [Auftrag] and  [Position] are different fields that need to be arranged in columns in an internal table. this .DAT fiel which I want to upload and then SPLIT it into various fields will will treated as MASTER DATA table for further programming. The program that I had written is as below. Also please refer the attached .DAT table.
    Please if any one could help me. i searched a lot in different forums but couldn't find me  a solution. Also note that the attached fiel is in text (.txt) format here but in real situation the same fiel is in DATA (.DAT) format.
    Types: Begin of ttab,
            Rec(1000) type c,
           End of ttab.
    DATA: itab  type table of ttab.
    DATA: wa_tab type ttab.
    DATA: file_str type string.
    Parameters: p_file type localfile.
    At selection-screen on value-request for p_file.
                                           CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
    *                                          PROGRAM_NAME        = SYST-REPID
    *                                          DYNPRO_NUMBER       = SYST-DYNNR
    *                                          FIELD_NAME          = ' '
                                               STATIC              = 'X'
    *                                          MASK                = ' '
                                               file_name           = p_file.
    *                                        EXCEPTIONS
    *                                          MASK_TOO_LONG       = 1
    *                                          OTHERS              = 2
      file_str = P_file.
          filename                      = '\\\Volume_1\_projekte\Zeiterfassung-SAP\BUP_ZEIT.DAT'   " This the file  source address
          FILETYPE                      = 'DAT'
          HAS_FIELD_SEPARATOR           = ';'
    *     HEADER_LENGTH                 = 0
    *     READ_BY_LINE                  = 'X'
    *     DAT_MODE                      = ' '
    *     CODEPAGE                      = ' '
    *     IGNORE_CERR                   = ABAP_TRUE
    *     REPLACEMENT                   = '#'
    *     CHECK_BOM                     = ' '
    *     VIRUS_SCAN_PROFILE            =
    *     NO_AUTH_CHECK                 = ' '
    *     FILELENGTH                    =
    *     HEADER                        =
          data_tab                      = itab
         FILE_OPEN_ERROR               = 1
         FILE_READ_ERROR               = 2
         NO_BATCH                      = 3
         GUI_REFUSE_FILETRANSFER       = 4
         INVALID_TYPE                  = 5
         NO_AUTHORITY                  = 6
         UNKNOWN_ERROR                 = 7
         BAD_DATA_FORMAT               = 8
         HEADER_NOT_ALLOWED            = 9
         SEPARATOR_NOT_ALLOWED         = 10
         HEADER_TOO_LONG               = 11
         UNKNOWN_DP_ERROR              = 12
         ACCESS_DENIED                 = 13
         DP_OUT_OF_MEMORY              = 14
         DISK_FULL                     = 15
         DP_TIMEOUT                    = 16
         OTHERS                        = 17
      IF sy-subrc <> 0.
      LOOP at itab into wa_tab.
            WRITE: / wa_tab.
    I will be grateful to all you experts for ur inputs
    Chandan Singh

    For every Auftrag, there are multiple Position entries.
    Rest of the blocks don't seems to have any relation.
    So you can check this code to see how internal table lt_str is built whose first 3 fields have data contained in Auftrag, and next 3 fields have Position data. The structure is flat, assuming that every Position record is related to preceding Auftrag.
    Try out this snippet.
    DATA lt_data TYPE TABLE OF string.
    DATA lv_data TYPE string.
    CALL METHOD cl_gui_frontend_services=>gui_upload
        filename = 'C:\temp\test.txt'
        data_tab = lt_data
        OTHERS   = 19.
    CHECK sy-subrc EQ 0.
    BEGIN OF ty_str,
      a1 TYPE string,
      a2 TYPE string,
      a3 TYPE string,
      p1 TYPE string,
      p2 TYPE string,
      p3 TYPE string,
    END OF ty_str.
    DATA: lt_str TYPE TABLE OF ty_str,
          ls_str TYPE ty_str,
          lv_block TYPE string,
          lv_flag TYPE boolean.
    LOOP AT lt_data INTO lv_data.
      CASE lv_data.
        WHEN '[Version]' OR '[StdSatz]' OR '[Arbeitstag]' OR '[Pecunia]'
             OR '[Mita]' OR '[Kunde]' OR '[Auftrag]' OR '[Position]'.
          lv_block = lv_data.
          lv_flag = abap_false.
        WHEN OTHERS.
          lv_flag = abap_true.
      CHECK lv_flag EQ abap_true.
      CASE lv_block.
        WHEN '[Auftrag]'.
          SPLIT lv_data AT ';' INTO ls_str-a1 ls_str-a2 ls_str-a3.
        WHEN '[Position]'.
          SPLIT lv_data AT ';' INTO ls_str-p1 ls_str-p2 ls_str-p3.
          APPEND ls_str TO lt_str.

  • Filename seperately & Putting data from Hash Map to two different columns

    The following code produces the output as :
    $ java getNamefile
    File Name : reaper.txt
    File Name : Testing
    Is it possible to just get the file name "reaper" from it instead of reaper.txt
    class getNamefile
         public static void main(String[] args)
              File f1 = new File("C:/javamyprograms/reaper.txt");
              File f2 = new File("C:/javamyprograms/Testing/");
              System.out.println("File Name : " + f1.getName());
              System.out.println("File Name : " + f2.getName());
    }Secondly I am trying to put the values from a HashMap into ".xls"
    PrintWriter out = new PrintWriter (new FileWriter("Unique_words_count" + file) + ".xls");
    and out.write(key + " " + hm.get(key));
    This put the values in the same columns. I want the results to be two different columns like
    column1 column2
    key1 value1
    key2 value2
    Please do advise. Thanks in advance.

    Is it possible to just get the file name "reaper"from it instead of reaper.txtActually, I ran a test, and
         System.out.println(  "file name portion == " + ( f.getName().split( "\\." ) )[ 0 ] );works also:
    This has the same effect as:
         String fileName = f.getName();
         String splitFileName[] = fileName.split( "\\." );
         System.out.println(  "file name portion == " + splitFileName[ 0 ] );Now that I think about it, the second form is more easily understood. There is really no reason to do it the first way. Just interesting to note that you can.

  • How do I import photos to iPad2 from different folders in my Mac?

    How do I import photos to iPad2 from different folders in my Mac?
    I have a few folders of photos in my mac that I want to be on my iPad2. How do I go about on doing that?
    It seems like I need to put all the folders into one folder and point iTunes to that main folder.
    The thing is I don't want to copy them (waste of space) and I don't want to move them (my photos are organized).
    So is there a way for me to import photos from different folders in my mac to my iPad2?
    Thank you!
    BTW... I don't use iPhoto.

    Find software (which may not exist) to export them in a photo format (jpeg, tiff). IPhoto will not do it

  • Passing data to different internal tables with different columns from a comma delimited file

    I have a program wherein we upload a comma delimited file and based on the region( we have drop down in the selection screen to pick the region).  Based on the region, the data from the file is passed to internal table. For region A, we have 10 columns and for region B we have 9 columns.
    There is a split statement (split at comma) used to break the data into different columns.
    I need to add hard error messages if the no. of columns in the uploaded file are incorrect. For example, if the uploaded file is of type region A, then the uploaded file should be split into 10 columns. If the file contains lesser or more columns thenan error message should be added. Similar is the case with region B.
    I do not want to remove the existing split statement(existing code). Is there a way I can exactly pass the data into the internal table accurately? I have gone through some posts where in they have made use of the method cl_alv_table_create=>create_dynamic_table by passing the field catalog. But I cannot use this as I have two different internal tables to be populated based on the region. Appreciate help on this.

    Hi Abhishek,
    I have no issues with the rows. I have a file with format like a1,b1,c1,d1,e1, the file should be uploaded and split at comma. So far its fine. After this, if the file is related to region A say Asia, then it should have 5 fields( as an example). So, all the 5 values a1,b1..e1 will be passed to 5 fields of itab1.
    I also have region B( say Europe)  whose file will have only 4 fields. So, file is of the form a2,b2,c2,d2. Again data is split at comma and passed to itab2.
    If some one loads file related to Asia and the file has only 4 fields  then the data would be incorrect. Similar is the case when someone tries to load Europe file with 5 fields related data. To avoid this, I want to validate the data uploaded. For this, I want to count the no. of fields (seperated by comma). If no. of fields is 5 then the file is related to Asia or if no. of fields is 4 then it is Europe file.
    Well, the no. of commas is nothing but no. of fields - 1. If the file is of the form a1,b1..e1 then I can say like if no. of commas = 4 then it is File Asia.But I am not sure how to write a code for this.Please advise.

Maybe you are looking for