Advanced Custom Field help. Need fiscal quarter/fiscal week.

A coworker is setting up an MS Project...project, and she asked
for some help adding a custom field that would convert the Start date field into our Fiscal Quarter Fiscal Week schema, to display as FQFW, e.g. Q1W1. I've written a formula that accomplishes this quite nicely in excel, but I've never even touched Project
until this week. Apparently it doesn't take formulas quite the same way as Excel does. I tried using the ''Switch" function in Project, and it worked, but it only accepts 14 arguments(right?), and there are obviously 52 weeks we're dealing with. Does
anyone have any suggestions? Would there be a way to do this using VBA? (I know next to nothing here as well.)
Formula in excel where A1 is the Start Date:
=IF(AND(A1>=DATE(2014,2,1),A1<=DATE(2014,5,2)),CONCATENATE("Q1","W",(INT((A1-DATE(2014,2,1))/7)+1)),IF(AND(A1>=DATE(2014,5,3),A1<=DATE(2014,8,1)),CONCATENATE("Q2","W",(INT((A1-DATE(2014,5,3))/7)+1)),IF(AND(A1>=DATE(2014,8,2),A1<=DATE(2014,10,31)),CONCATENATE("Q3","W",(INT((A1-DATE(2014,8,2))/7)+1)),IF(AND(A1>=DATE(2014,11,1),A1<=DATE(2015,1,30)),CONCATENATE("Q4","W",(INT((A1-DATE(2014,11,1))/7)+1)),FALSE))))
Any and all suggestions welcome.
Thanks.

msinnen,
You're correct, switch statements and if statements can only be nested to 15 levels. However, VBA can get you there. This macro should do what your coworker needs with the following assumptions - the fiscal year starts in January and quarters end on the
last day of the month, not the last Friday. If either or both of those assumptions are incorrect, then this macro will need some tweaking. Note: the quarter and work week designator will be written into the Text1 field.
Sub FQuartsandWeeks90()
Dim t As Task
Dim Mon As Integer
Dim Qtr As String, Wk As String
For Each t In ActiveProject.Tasks
    If Not t Is Nothing Then
        t.Text1 = ""
        Mon = Month(t.Start)
        Select Case Mon
            Case 1 To 3
                Qtr = "Q1"
                Wk = "W" & CStr(DatePart("ww", t.Start))
            Case 4 To 6
                Qtr = "Q2"
                Wk = "W" & CStr(DatePart("ww", t.Start) - 13)
            Case 7 To 9
                Qtr = "Q3"
                Wk = "W" & CStr(DatePart("ww", t.Start) - 26)
            Case Else
                Qtr = "Q4"
                Wk = "W" & CStr(DatePart("ww", t.Start) - 39)
        End Select
        t.Text1 = Qtr & Wk
    End If
Next t
End Sub
John

Similar Messages

  • Custom field is needed in the Shopping cart Additional Specifications

    Hi Folks,
    A Custom field is needed in the Shopping cart Additional Specifications just below 'Notes for Approval'. Any suggestions on this.
    Thanks,
    Ghanesh

    Hi
    <b>Please go through the following links, which will definitely help -></b>
    Re: Displaying Custom field in shopping cart header
    Re: customer field in 3rd step of shopping cart
    Re: Custom Screen in Shopping cart
    Re: Custom Field in the header of Shopping Cart
    Custom field in shopping cart Item Overview - items in Shopping Cart tab
    SC : Extended  Search on Header Customer field
    Regards
    - Atul

  • Duplicate Data Fields Help Needed

    We have a 9 page Word form that has some duplicate information, have converted it to LiveCycle but am stuck on finding out how to have the data from one field also show in another so the user does not have to enter twice.  Eventually we will remove the duplicate fields, but for many reasons, right now they must remain.  I don't want a Contractor to have to enter their Company name twice, etc., and have my main data collection form in the front of the 9 pages, and then when they get to the last page with sigs, etc., I would like what they've already entered for their Company information to show.
    I am very new to Designer ES, and when I did some forms in Adobe 9.0 Forms awhile back, all I needed to do was to name the fields the same and if I entered info in one it would show in the other.  ES does not seem to do that, and I can't seem to find out how to add any code to the field.  Don't know why but alot of my options are grayed out.
    Anyway, would very much appreciate help, thank you.

    Giving them the same name is only one part of the solution ....you have to change the binding (on the Object palette/binding tab) to Global.
    Paul

  • Making IP Address field - help needed

    Hi All,
    Can anyone tell me how to make the IP Address field as displayed in windows operating system network settings.
    Actually I have made one IP field using JFormattedTextField and MaskFormatter class.
    code is given below:
    private MaskFormatter getMf2() {
    if (mf2 == null) {
    try {
    mf2 = new MaskFormatter(" *** . *** . *** . *** ");
    mf2.setValidCharacters(" 0123456789");
    } catch (Exception e) {
    JOptionPane.showMessageDialog(null, e.toString());
    return mf2;
    jTextField = new JFormattedTextField(getMf2());
    Am I doing anything wrong here?
    Problem is its not behaving in the way windows operating system IP field behaves?
    Actually I am unable to display 3 dots(.) in the field which look like they are with regular space gap in the jformattedtextfield?
    In windows OS, dots in the IP address field will remain static, but with my IP field, they are moving when I am adding values into the field? How to solve this problem?
    I have given three spaces in the mask formatter initially? so if I click on the first place, I am unable to type at that place? how to rectify this problem?
    Please anyone help me to solve this problem and make proper IP field as it looks in windows operating system. If Any code is available in the web, please provide the link here.

    Answered in cross posting.

  • Custom Trigger help needed

    How do I include values from existing recordsets in a SQL statement
    within a Custom Trigger?
    For example, my page has a few recordsets. Assume one of the recordsets
    tells me what state the current user lives in. $row_rsCurUsr['state']
    There is an Insert form on the page with a Custom Trigger (after)
    attached. I need the Custom Trigger to perform another action (insert,
    update, delete, whatever) but it needs to use the $row_rsCurUsr['state']
    value. How can I do this?
    I've tried something similar to:
    $triggerSql = "INSERT INTO anothertable (id, state) VALUES
    ({SESSION.kt_login_id},{rsCurUsr.state})";
    and
    $triggerSql = "INSERT INTO anothertable (id, state) VALUES
    (".$_SESSION['kt_login_id'].",".$row_rsCurUsr['state'].")";
    but neither seems to work.
    Alec
    Adobe Community Expert

    Ok. How about executing a SELECT inside a Custom Trigger and accessing
    the resulting rows to use in PHP code also in the trigger?
    Example - within the Custom Trigger execute:
    $sql="SELECT * FROM table";
    How do I execute it? With the regular DW code like:
    mysql_select_db($database_conWV, $conWV);
    $sql="SELECT * FROM table";
    $result = mysql_query($sql, $conWV) or die(mysql_error());
    $row_result = mysql_fetch_assoc($result);
    $totalRows_result = mysql_num_rows($result);
    or with some ADDT code like:
    $result = $tNG->connection->execute($sql);
    If I do the "ADDT" way, how do I access the rows?
    $result['column'] or something?
    Alec
    Adobe Community Expert

  • Need to add superscript for text field--HELP NEEDED.

    Hi Friends,
    Is there any way to implement superscript and subscript text in Crystal?  For example, I would like to superscript the portion (1) of the following string:
    "Buy(1) or Sell(1)"
    The only way I have found to do this is to put the "235" in a separate text field that uses a smaller font size, and overlay it into the gap that I intentionally left in the larger text field.  For display and printing purposes, this works OK, but if a report containing these strings is exported to Excel, the text fields are exported as separate cells, which makes the exported report look funny.
    I can create this string in Word, then cut and paste it into a text field in Crystal (which initially seems to work), but as soon as I click off the field, all the characters in it are converted to the same font size.
    If this can't be done in the current version of Crystal, are there any plans for it to be implemented in future versions?

    hello all,
    the text interpretation for html or rtf in fields will not render superscript or subscript. the basic rule is that whatever you can format directly in a crystal reports text object, that's what you can have interpreted.
    look up "text interpretation html" in kbase for a full list.
    one option is to turn html passthrough on the server in question if this is a huge deal for you...if you want instructions on how to turn html passthrough on, they are located in the webelements user guide at
    http://diamond.businessobjects.com/node/255
    after doing so, you'd drop the database field into a formula and any html in the database field would be interpreted.

  • Custom text - help needed

    Hi Guys, I've got to design a Family Tree for a client and they want a very particular style. An arc sits at the bottom centre of the page, and inside the arc there are two names/birthdays/deaths/marriages etc. At right angles outside the arc, more names/births/deaths/marriages are listed. For each new generation there will be a new arc, and each new name etc will be at right angles to the arc below, no matter where they sit on the arc. I've done a really rough example of what they want.
    So basically my question is this: can it be done easily? (typing on text paths, scripts etc etc..)  I really don't want to have to put each new name into an individual text box and rotate to the correct angle, if I can help it. There are up to 8 generations and several hundred names. Family tree goes back to early 1800's...
    Any help would be greatly appreciated!

    It looks like a great opportunity to write a script. After all, it's all just maths; the names 'above' the root can evenly be distributed by dividing the available arc (180°) by the number of names (3), resulting in a separation of 60°, and the initial angle should be half that of that separation. So the first name is at 30°, the second at 90°, the third at 150°, and then there is a remainder of 30° again for the right side.
    These same values should be used for the next layer of this onion (family trees can be smelly too), but this time I think the content should be centered on that angle, so the angle for each single line depends on the number of lines in that branch.
    It sounds perfectly doable with a script, apart for one thing: how are you going to point out what texts must go where?

  • Custom Exit  help needed

    HI ,
    I have developed a custom exit , to restrict based on USER who logs in and gets detais for him from my two ODS in the report
    the code is some thing like this
    FOR I_STEP = 2 .
    select zempno from /bic/azhrpe00100 into table itab1 where /bic/zspnm = sy-uname.
    select zempno from /bic/azhrpe00100 into table itab2 where /bic/zspnm = sy-uname.
    CLEAR L_S_RANGE.
    loop at itab1 into temp_zempno1.
    L_S_RANGE-LOW = temp_zempno1.
    L_S_RANGE-SIGN = 'I'.
    L_S_RANGE-OPT = 'EQ'.
    APPEND L_S_RANGE TO E_T_RANGE.
    EXIT.
    ENDLOOP.
    CLEAR L_S_RANGE.
    loop at itab2 into temp_zempno2.
    L_S_RANGE-LOW = temp_zempno2.
    L_S_RANGE-SIGN = 'I'.
    L_S_RANGE-OPT = 'EQ'.
    APPEND L_S_RANGE TO E_T_RANGE.
    EXIT.
    ENDLOOP.
    SORT E_T_RANGE.
    DELETE ADJACENT DUPLICATES FROM E_T_RANGE.
    ENDIF.
    this is my code , when i debug i can see E_T_RANGE getting the values , for the STEP 2 , but i am getting this error
    <b>Error: Error for variable in customer enhancement ZEMPLO</b>

    Hi,
    For what variable? (Remember => NOT ready for Input! and mandatory input)
    a.) encapsulate it by
    FOR I_STEP = 2.
    CASE I_VNAM.
    WHEN <Your Variable>.
    Your Coding
    endcase.
    b.) also assign a high value.
    L_S_RANGE-LOW = temp_zempno1.
    L_S_RANGE-HIGH = temp_zempno1. "as well as for zempno2.
    L_S_RANGE-SIGN = 'I'.
    hth
    cheers
    sven

  • Advanced Group Sorting Help Needed

    In a previous thread,I was able to great two levels of hierarchy:
    1) Group by Case Worker
       2) All clients that pertained to their caseload (assigned client)
    The initial problem was, it was pulling duplicate records because each client had multiple instances of treatment plans, but I was more concerned about the most recent begin date. within Section Expert > Details, I use the following formula
    {AZCLPLAN.BEG_DATE} <> maximum ({AZCLPLAN.BEG_DATE}, {CDCLIENT.CASE_NUM})
    This successfully pulled the most recent treatment plan for the client record, ignoring all previous records. However, the case worker wants to see their caseload sorted by which treatment plans are ending first (AZCPLAN.END_DATE). When I add a new group END_DATE, move it up the hierarchy for sorting, it breaks my duplicate record sort rule.
    In laymen terms, after the report strips the duplicates only showing the most recent records, I want to do a sort by dates thereafter. how is this possible?

    I tried adding Record Sort Expert. By default the two hierarchy groups are locked at the top tiers. The 3rd item is solely the record file: ..END_DATE set to ascending.
    Under the Caseworker Group (highest tier) , next group in line is CASE_NUM. therefore, once a group is in place, it trumps anything below it (currently sorted by chart/case number). I tried changing the Group Expert > CASE_NUM to "original order" , but no luck.

  • Add custom fields in check status

    Hi Gurus,
    Please help me out in this. My requirement is I need to add two custiom fields in the check status (bbpsc04) and based on the values entered in the custom fields I need to search for the shopping carts.
    Please let me know how to add two fields in the check status and fetch the data based on the values entered in the custom fields.
    Thanks in advance,
    Andy.

    Hi Andy,
    first you need to make the customer fields for the shopping cart (header or item level) I assume that's already done.
    Now to add the customer fields to the <u>extended</u> search you need to do the following:
    1. Define the customer field in include:
    a. SC HEADER INCL_EEW_PD_SEARCH_HDR_CSF_SC  
    OR
    b. SC ITEM INCL_EEW_PD_SEARCH_ITM_CSF_SC
    you have to set fields XINPUT and XDISPLAY to 'X' in table ET_FIELDS for the fields you want to use in BADI BBP_CUF_BADI_2 in method MODIFY_SCREEN. The fields defined this way are displayed if you choose the 'Extended search' link.
    Refer to note 672960 - "User-defined fields 2" For more detailed instructions.

  • Customer Fields not getting poplulated in PO in R/3 (ECC 6.0) from SRM 5.0

    Hi,
        We Recently upgraded our R/3 System from 4.6 C to ECC 6.0.
    Shopping card number is getting created in SRM side and after approval it is getting sent to R/3 Back end,We have some customer fields that need to be populated in the back end from the shopping card,Which is not happening as of now.We are using the BAPI_PO_CREATE1 for creating the PO in R/3.We tried running the BAPI_PO_CREATE1 Standalone by giving the customer fields Table EXTENSIONIN and in Structure BAPI_TE_PO_ITEMS,But the custom fields are not populating in the PO.
    Pls suggest,
    Thanks
    Rakesh.

    Hi Rakesh ,
    1.wat is ur target table  that  ur  custom fields were  added using apped structure.
    2. Have u passed the Communcation strucure also means
    in ur case BAPI_TE_MEPOITEMX along with BAPI_TE_MEPOITEM .
    Plz find  similar code which is for  sale order coding which may  help u .
    ***Constant Declarations
    Constant: C_BAPE_VBAP (9) type u2018BAPE_VBAPu2019,
              C_BAPE_VBAPX (10) type u2018BAPE_VBAPXu2019
    TYPES:    BEGIN OF T_BAPE_VBAP,
               VBELN TYPE VBELN_VA,
               POSNR TYPE POSNR_VA,
               ZZcontract_num type ZZcontract_num "Custom field
              END OF T_BAPE_VBAP.
    ***Communication Fields
    TYPES: BEGIN OF T_BAPE_VBAPX,
            VBELN TYPE VBELN_VA,
            POSNR TYPE POSNR_VA,
            ZZcontract_numX type CHAR1,
           END OF T_BAPE_VBAPX.
    Declaring the Internal table and Work areas
    DATA: I_EXTENSIONIN TYPE STANDARD TABLE OF BAPIPAREX.  u201CInternal table                             for BAPI Extension Table
          w_EXTENSIONIN like line of I_EXTENSIONIN,             u201CWork area for BapiExtension Table
         I_return type standard table of bapiret2,
       W_return like line of i_return,
          is_BAPE_VBAP    type    T_BAPE_VBAP,              u201CStructure declaration
          is_BAPE_VBAPX type T_BAPE_VBAPX,            u201CStructure declaration
          v_vbeln  type   BAPE_VBAP-VBELN,            u201CVariable for the doc no     
          v_posnr type BAPE_VBAP-POSNR,                  u201CVariable for the itemnumber
      v_zzcontract_num type BAPE_VBAP-ZZcontract_num, u201CVariable for the Contract number
    Filling the BAPI table Extension Structure.
               W_BAPE_VBAP-VBELN =u201D00001234u2019.
               W_BAPE_VBAP-POSNR =u2019000010u2019 .
               W_BAPE_VBAP-ZZcontract = 'ABC123'.
    W_EXTENSIONIN-STRUCTURE = C_BAPE_VBAP.
    w_EXTENSIONIN+30 =W_BAPE_VBAP.
    APPEND W_EXTENSIONIN TO I_EXTENSIONIN.
    CLEAR w_EXTENSIONIN..
               k_BAPE_VBAP-VBELN =u201D00001234u2019.
               W_BAPE_VBAP-POSNR =u2019000010u2019 .
    W_BAPE_VBAP-ZZcontractx = 'X'.
    *********same to pass Communication Structure.
    W_EXTENSIONIN-STRUCTURE = C_BAPE_VBAPX.
    w_EXTENSIONIN+30 = W_BAPE_VBAPX.
    APPEND W_EXTENSIONIN TO I_EXTENSIONIN.
    CLEAR w_EXTENSIONIN.
      6) Then Call BAPI u2018BAPI_SALESORDER_CHANGE u2018to Update Sale Order with Contract number
      CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
        EXPORTING
          SALESDOCUMENT    = V_SALORD_NUMBER
          ORDER_HEADER_IN  = K_ORDER_HEADER_IN
          ORDER_HEADER_INX = K_ORDER_HEADER_INX
        TABLES
          RETURN           = I_RETURN
          ORDER_ITEM_IN    = I_ORDER_ITEM_IN
          ORDER_ITEM_INX   = I_ORDER_ITEM_INX
          EXTENSIONIN      = I_EXTENSIONIN.
    ****COMMIT WORK AND WAIT.
      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
        EXPORTING
          WAIT = 'X'.
    Hope it may help you
    Rgds
    Sree

  • In LSMW how to include customer fields in BAPI method ?

    Hi all,
    We have a requirement to use BAPI method in LSMW. We have some custom fields defined needs to be handled in BAPI structures.Please tell me how to handle BAPI extension structures(EXTENSIONIN/OUT) in LSMW.

    Hi Venugopal,
    You can use the sold to party field fiield for your requirement.
    Press f4, you will get a pop up to select customer depending on various selection criteria including customer name.
    If can enter the customer name, which will sort out the sold to party number whihc you can use.
    If this is not wat is required you have to copy the transaction and create a new Zreport.
    Hope this helps you.
    Thanks
    Arun

  • Mm17 custom fields

    Hi )
    Please, help me.......
    I have extended the material master tables MARA with custom fields. I now wish to make these fields mass maintainable using MM17.
    When I go to the mass maintenance screen, I am unable to see my fields there.
    Sap version - 6.0

    Sveta V wrote:
    > IDOC e1maram not including my fields...........
    For filling up the custom fields you need to find proper customer exit in the function module (IDoc Outbound ) and fill the SDATA with your custom fields

  • Address Book, importing text tab file, custom fields not there

    Searched thru all past posts. Found some that are close but not what I am trying to do.
    Open Address Book, go into Preferences, select Template and under the Names field (friend, assistant, father, etc) I add a custom field called "Keyword".
    I also add two more custom fields in the Phone area called "Work 3" and "Work 4". There are other custom fields I need but I want to keep this short.
    Quit Address Book then relaunch. Add a new contact and the new custom fields, Keyword, Work 3 and Work 4 are there. All good so far.
    I have a Now Contact file with about 800 contacts in it. I export all fields as a Text file, Tab delimited. No problems there. With Address Book launched, select Import, pick the text file, leave Text Encoding on Automatic and click Open.
    The window that shows the fields for Address Book and fields for the text file side by side opens. This is where you match up the correct fields for importing. If I go to one of the fields from the text file that I created a custom field for, click under the Address Book heading on the Do not import, scroll thru the Apple choices of fields, none of the custom fields show up. Only the original Apple ones are there. Why does Apple let you create them in the Template area but not have them available for importing?
    That is my problem.
    Adding new contacts as I get them, is fine. Importing 800 contacts with these custom fields is not possible.
    I could map them to go to the Notes field along with actual notes but that is inelegant. The custom fields are there, why can't we use them to their full potential.
    This appears to be a bug to me. Let me know what you think.

    Hi Adam,
    Thanks, but the problem is not importing to AddressBook, it is exporting.  I did discover from another that I can export very easily to a Numbers spreedsheet.  It is exceptionally simple.  But it will not export custom fields.  Someone said that is because of a vcard standard.  My custom fields are just "name" fields that I have labeled differently.  But Numbers does not support the name (it only takes the name of the card).
    Christine

  • Custom Fields from SRM 7.0 to R/3 4.7

    Hi,
    I have some custom field which need to be passed from the SRM confimation to R/3 - GR, I learnt that Idoc MBGMCR01 is triggered to create the GR in R/3.
    1. Wether I have to create a new IDOC type and assign in the message type? Please let me know in which BADI i can populate the value for the custom Fields
    Edited by: prabhu jayaraman on Oct 5, 2009 3:38 AM

    Hello Prabhu,
    You need not create a new idoc. You can extend the existing Idoc using extensions.
    However in the related FM BBP_ALE_GOODSMVT_CREATE which triggers the Idoc , i do not see any BADI being called.
    Best Regards,
    Pavan
    Edited by: pavancv on Nov 18, 2009 4:13 PM

Maybe you are looking for