Calculating One Value from Three Possible Values

I want to generate a list of customer phone numbers to call from a database. A customer may have a primary phone number, a business phone number, and a cell phone number. I only want one to call one phone number from each customer. If the primary phone number is available, then it should be on the list. If the primary number is blank or 999-999-9999, then list the business phone number instead. If the business phone number is blank or 999-999-9999, then call the cell number instead. If the cell number is blank or 999-999-9999, then don't list the customer at all.
Also, only list distinct phone numbers so that the same phone number isn't called more than once.
I've tried various approaches, but can't get this work. Any ideas on how I should attack this?
Thanks,
Eric

For the 1st question... A formula like this should do the trick:
IF NOT IsNull({TableName.PrimaryPhone})
AND {TableName.PrimaryPhone} <> ""
AND {TableName.PrimaryPhone} <> "999-999-9999"
THEN {TableName.PrimaryPhone} ELSE
IF NOT IsNull({TableName.BusinessPhone})
AND {TableName.BusinessPhone} <> ""
AND {TableName.BusinessPhone} <> "999-999-9999"
THEN {TableName.BusinessPhone} ELSE
IF NOT IsNull({TableName.CellPhone})
AND {TableName.CellPhone} <> ""
AND {TableName.CellPhone} <> "999-999-9999"
THEN {TableName.CellPhone} ELSE
"No Phone Number Available"
As for your 2nd question...
Also, only list distinct phone numbers so that the same phone number isn't called more than once.
This is a function of your data. If you have multiple customers that share the same phone number, then it stands to reason that this 1 phone number would legitimately apply to multiple customers. I could see not wanting to call the same home number multiple times for different customers who live under the same roof but what about different customers who work for the same company?
You need determine exactly what you want to happen in the event there are matched numbers, including which customer takes priority in terms of which one keeps the numbers and which ones get eliminated.
Jason

Similar Messages

  • [Forum FAQ] SharePoint 2013: Extracting values from a multi-value enabled lookup column and merge values to a multi-value enabled column

    For some business requirements, users want to extract values from a multi-value enabled lookup column
    and add items to another list based on each separate value. In contrast, others want to find duplicate values in the list and merge associated values to a multi-value enabled column and then
    add items to another list based on the merged value. All of these can be achieved using SharePoint Designer 2013 Workflow.
    How to extract values from a multi-value enabled lookup column and add items to another list based
    on each separate value using SharePoint Designer 2013.
    Important actions: Loop Shape; Utility Actions
    Three scenarios
    Things to note
    Steps to create Workflow
    How to merge values to a multi-value enabled column and add item to another list based on the
    merged value using SharePoint Designer 2013.
    Important actions: Call HTTP Web Service; Build Dictionary
    Things to note
    Steps to create Workflow
    How to
    extract values from a multi-value enabled lookup column and
    add items to another list based on each separate value using SharePoint Designer 2013.
    For example, they have three lists as below. They want to
    extract values from the Destinations column
    in Lookup2 and add items to Lookup3 based on each country and set Title to current item: ID.
    Lookup1:
    Title (Single line of text)
    Lookup2:
    Title (Single line of text), Destinations (Lookup; Get information from: Lookup1 in Title column).\
    Lookup3:
    Title (Single line of text), Country (Single line of text).
    Important action
    1. Loop Shape: SharePoint Designer 2013 support two types of loops: loop n times and loop with condition.
    Loops must also conform to the following rules:
    Loops must be within a stage, and stages cannot be within a loop.
    Steps may be within a loop.
    Loops may have only one entry and one exit point.
    2. Utility Actions: It contains many actions, such as ‘Extract Substring from Index of String’ and ‘Find substring in String’.
    Three scenarios
    We need to loop through the string returned from the look up column and look for commas. There are three
    scenarios:
    1.  No comma but string is non-empty so there is only one country.
    2.  At least one comma so there is at least two or more countries to loop.
    3.  In the loop we have consumed all the commas so we have found the last country. 
    Things to note
    There are two things to note:
    1. "Find string in string (output to Variable:index)"  will return -1 if doesn't find
    the searched for string.
    2. In the opening statement "Set Variable: Countries to Current Item:Destinations" set the return
    field as  "Lookup Values, Comma Delimited".
    Steps to create Workflow
    Create a custom list named Lookup1.
    Create a custom list named Lookup2, add column: Destinations (Lookup; Get information from: Lookup1 in Title column).
    Create a custom list named Lookup3, add column: Country (Single line of text).
    Create a workflow associated to Lookup2.
    Add conditions and actions:
    Start the workflow automatically when an item is created.
    Add item to Lookup2, then workflow will be started automatically and create multiple items to lookup3.
    See the below in workflow History List:
    How to merge values to a multi-value enabled column and add item to another list based on the
    merged value using SharePoint Designer 2013
    For example, they have three lists as below. They want to find duplicate values in the Title column in
    Lookup3 and merge country column to a multi-value enabled column and then add item to lookup2 and set the Title to Current Item: Title.
    Lookup1:
    Title (Single line of text)
    Lookup3:
    Title (Single line of text), Country (Single line of text).
    Lookup2:
    Title (Single line of text), Test (Single line of text).
    Important actions
    "Call HTTP Web Service"
    action: In SharePoint 2013 workflows, we can call a web service using a new action introduced in SharePoint 2013 named Call HTTP Web Service. This action
    is flexible and allows you to make simple calls to a web service easily, or, if needed, you can create more complex calls using HTTP verbs as well as allowing you to add HTTP headers.
    “Build Dictionary"
    action:
    The Dictionary variable type is a new variable type in the SharePoint 2013 Workflow.
    The following are the three actions specifically designed for the Dictionary variable type: Build Dictionary, Count Items in a Dictionary and Get an Item from a Dictionary.
    The "Call HTTP Web Service" workflow action would be useless without the new "Dictionary" workflow action.
    Things to note
    The
    HTTP URI is set to https://sitename/_api/web/lists/GetByTitle('listname')/items?$orderby=Id%20desc and the HTTP method is set to “GET”. Then the list will be sort by Id in descending order.
    Use Get
    d/results(0)/Id form
    Variable: ResponseContent (Output to
    Variable: maxid) to get the Max ID.
    Use Set
    Variable: minid to Current List:ID to get the Min ID.
    Use Copy from
    Variable: destianation , starting at
    1 (Output to
    Variable: destianation) to remove the space.
    Steps to create Workflow
    Create a custom list named Lookup1.
    Create a custom list named Lookup2, add column: Test (Single line of text).
    Create a custom list named Lookup3, add column: Country (Single line of text).
    Create a workflow associated to Lookup3.
    Add a new "Build Dictionary" action
    to define the http request header:
    Add a Call HTTP Web Serviceaction, click on
    this and paste your http request.
    To associate the
    RequestHeader variable, select the Call action property,
    set the
    RequestHeaders property to
    RequestHeader:
    In the Call action, click on
    response and associate the response to a new
    variable: ResponseContent (of type Dictionary).
    After the Call action add Get item from Dictionary action to get the Max ID.
    Add Set Workflow Variable action to get the Min ID.
    Add Loop Shape (Loop with Condition) to get all the duplicate titles and integrate them to a string.
    Create item in Lookup2.
    The final Stage should look like this:
    Start the workflow automatically when an item is created.
    Add item to Lookup3, then workflow will be started automatically and create item to lookup2.
    See the below in workflow History List:
    References
    SharePoint Designer 2013 - Extracting values from a multi-value enabled lookup column into a dictionary as separate items:
    http://social.technet.microsoft.com/Forums/en-US/97d34468-1b53-4741-88b0-958472f8ca9a/sharepoint-designer-2013-extracting-values-from-a-multivalue-enabled-lookup-column-into-a
    Workflow actions quick reference (SharePoint 2013 Workflow platform):
    http://msdn.microsoft.com/en-us/library/jj164026.aspx
    Understanding Dictionary actions in SharePoint Designer 2013:
    http://msdn.microsoft.com/en-us/library/office/jj554504.aspx
    Working with Web Services in SharePoint 2013 Workflows using SharePoint Designer 2013:
    http://msdn.microsoft.com/en-us/library/office/dn567558.aspx
    Calling the SharePoint 2013 Rest API from a SharePoint Designer Workflow:
    http://sergeluca.wordpress.com/2013/04/09/calling-the-sharepoint-2013-rest-api-from-a-sharepoint-designer-workflow/

    GREAT info, but it may be helpful to note that when replacing a portion of the variable "Countries" with a whitespace character, you may cause the workflow to fail in a few specific cases (certain lookup fields will not accept this and will automatically
    cancel).  I only found this out when recreating your workflow on a similar, but much more complex list set.  
    To resolve this issue, I used another utility action (Extract Substring from Index of List) to clear out the whitespace.  I configured it as "Copy from
    Variable: Countries, starting at
    1 (Output to Variable: Countries), which takes care of this issue in those few cases.
    Otherwise, WOW!  AWESOME JOB!  Thanks!  :)

  • Get column values from list of values programmatically

    hi all
    how i get column values from list of values programmatically in the
    returnPopupDataListener method

    If this answers your question , please close this thread by marking it as answered.
    Thanks

  • Read more than one attribute from list of values record

    Hi,
    I am using Jdev 11.1.1.3.0.
    I have the following situation,
    have defined a read only view (schools information) which is a list of values for schools information ( schoolId, school name and school code) , I have to execute Query for that view as an Invoke Action in the executable s of the page,
    I need three attributes (A, B, C) in another view (name it student's school) to be set to the school information corresponding to a school chosen from a SelectOneChoice List
    I could not define the schools information as LOV for the attributes in the student's school, as I have to execute it in the executable s,
    I have an Iterator for the schools Information on the page and, bound the attribute A (from the student's school) SelectOneChoice as list to the school name (from school Information) , and then tried to read the current row of the schools Information Iterator like this inside a bean:
       Row  tempRow = getIteratorBinding("CmnLookupPrevSchoolRegView1Iterator").getCurrentRow();
       currStdPrevSchoolRow.setAttribute("B", tempRow.getAttribute("SchoolId"));
       currStdPrevSchoolRow.setAttribute("C", tempRow.getAttribute("SchoolCode"));but referring to the data saved in the DB, the values stored for the attributes B and C are not corresponding to the chosen school name , but corresponding to the first row of the iterator. ( not the current chosen)
    is there any suggestions, to have another approach to connect all the three attributes to the corresponding chosen values.
    or maybe it is just some properties for the Iterators,
    thanks in advance
    best regards,

    Hi,
    Have a look here: http://blogs.oracle.com/jdevotnharvest/2010/12/reading_the_selected_value_of_an_adf_bound_select_list_in_java.html
    If you read from a list binding then you get the row value from there as well - not from the iterator as lists don't change the current row
    Frank

  • How to access a value from "List of Values" by giving a name?

    I have a "List Of Values" defined in my BI Report. It comprises list of label-value pairs.
    I have defined a parameter :p_Value for the above "List Of Values" defnition. this parameter is used in datasource sql defnition to filter the query results. I configured a template which has a table that shows all the parameters used for filtering query results. If I give <?$p_Value?> in the template then the parameter value is rendered on it. But I want the "name" of the parameter and not the value. Can anybody tell me how to access name of the parameter which refers to one of value in "List of Value" defnition?

    option 1:
    Can you get the value from the DB in the report sql ?
    You have the code, inside the report query, if you can get the decoded value form that
    option2:
    create another paramater, LOV and query, and make it as hidden, and use the first :param_1_value in the lov query in the second param and decode the value.
    Now , you can refer the :PARAM_2_value in template which will have decoded value.

  • Sum calculated data results from three queries in another query

    Hello,
      I would like to read calculated data from three different queries and sum them in another query.  Is it possible to do it, please?

    Hi there,
    We have done this in Excel with a debtors report. I have five queries, each on a different sheet in a workbook. I have their total line appearing at the top of the results area.
    Then I have an Excel worksheet with Excel formulas to bring through the totals on the other reports.
    i.e.   +Sheet1!C30      + Sheet2!C35     + Sheet3!D40    = Result
    Hope this helps,
    Regards
    Gill

  • How to find first non zero value from the numeric value or string?

    Hiii, Every body
              I have one numeric indicator in which some valuse is coming with the decimal value, lets say 0.00013, now i want to find the first non-zero value from this numeric indicator, then what should i do to do so? i have converted it in the string, but i could not find any method to find first non-zero value from that string or either from the numeric indicator????
          Can you please help me, how to do it? i have attached the vi and write all the description inside.
    Thanks in Advance,
    Nisahnt
    Attachments:
    Find first nonzero.vi ‏20 KB

    Just convert it to an exponential string and take the first character .
    Message Edited by altenbach on 05-10-2006 08:00 AM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    FisrstNonzeroChar.png ‏3 KB
    FindFirstNonzeroCharacter.vi ‏20 KB

  • MDM Import Manager - remove multiple values from a multi valued fiedl

    Hi,
    We have this multi-valued field and we would like to clean the values from it.
    How can we do this using MDM Import Manager?
    Example:
    Article A
    Field XPTO has values Z, T and P.
    We want this field XPTO with no values. How can we do a mass actualization to clean the field for some articles?
    Thanks and regards,
    Maria

    *We have this multi-valued field and we would like to clean the values from it.
    How can we do this using MDM Import Manager?
    Example:
    Article A
    Field XPTO has values Z, T and P.
    We want this field XPTO with no values. How can we do a mass actualization to clean the field for some articles?*
    Hi Maria,
    There can be multiple ways to achieve this -
    1.After doing field mapping for XPTO you can set conversion filter for each of the values.
    2.Value map with NULL.
    3.Trigger a Workflow on import/record add,run assignment and make that field NULL.
    4.Run mass update for conditional assignment based on that value of XPTO.
    There can be more ways,whichever suits you best you can go ahead with that.
    Hope it helped
    Regards,
    Ravi

  • Reduce the field value from three decimal places to two decimal places

    hi experts,
    plz help me with this
    actually i have to display the  value of the field MENGE in the list with two decimal places.
    but when i go and see the field menge in the table mseg it is having three decimal places.
    so could u plz suggest me how to solve this.
    regards
    siri

    Please try using the DEIMALS extension of the WRITE statement.
    data: menge type menge_D value '1234'.
    write:/ menge decimals 2.
    Regards,
    RIch HEilman

  • Retrieve one row from multiple similar values column

    So, i have Following table records with repeated name with different emails -
    EmailDirc
    EmailID
    Ename
    Edob
    [email protected]
    Harish Salve
    15-10-1989
    [email protected]
    Navin Keddy
    17-02-1987
    [email protected]
    Harish Salve
    15-10-1989
    [email protected]
    Navin Keddy
    17-02-1987
    [email protected]
    Harish Salve
    15-10-1989
    [email protected]
    Harish Salve
    15-10-1989
    and now i want to retrieve rows on behalf of Ename like following -
    EmailDirc
    EmailID
    Ename
    Edob
    [email protected]
    Harish Salve
    15-10-1989
    [email protected]
    Navin Keddy
    17-02-1987
    kindly put some light to accomplish below required goal, thanks in advance.

    Try the below:
    Create Table EmailDir(emailid varchar(50),Ename varchar(100), Edob date)
    Insert into EmailDir Values('[email protected]','Harish Salve','10-15-1989'),
    ('[email protected]','Navin Keddy','02-17-1987'),
    ('[email protected]','Harish Salve','10-15-1989')
    ;With cte as
    Select EmailID,EName,Edob,Row_Number()Over(partition by EName Order by EmailID asc) Rn
    From EmailDir
    ) Select * From cte where rn=1
    Drop table EmailDir

  • Filter view object by selected values from list of values

    Hello,
    I've the following problem with my ADF Application. I have three view objects in my application module. Two of them are connected via a view link. For example take users, who are connected to their departments. The remaining view object consists of factories. Now I want to show the user/department dependency in a tree table and the available factories in a list of values. This list of values should be used to filter the shown users.
    I've already tried to use bind variables in the users view object. But I don't know how to fill them with the value of the list of values.
    Can someboy give me a tip how to solve this problem.
    Best regards,
    Enno

    Hi Enno,
    Try this:
    - Have a AM method with one parameter(which takes user from the list of values) and inside AM method write code to set the bind parameter value and execute the query
    Sample Code
    public void filterByUser(String user){
       //Get your UserViewObject instance to userVO
       userVO.setNamedWhereClauseParam("<Bind_Variable_Name>", user);
       userVO.executeQuery();
    }- Expose the method as client interface
    - Drop the method (Data Control) as a button on to the page and pass the listofvalues value as a value to the method binding param
    Something like this: ${bindings.<User>.inputValue}
    - Finally refresh the master and detail tables based on the ListOfValues selection by setting partialTriggers property to the listofvalues component id
    Hope it is clear
    Sireesha
    Edited by: Sireesha Pinninti on Oct 15, 2009 4:54 AM

  • Display specific value from List of Values(LOV)

    Hi All,
    Is this possible in BOXI R2 that i created a List of Values like below:
    1. P1AF
    2. P1XA
    3. P2AF
    4. P2XA
    5. P2XD
    6. P3AF
    7. P3XA
    8. P3XD
    and i would like to show only 1 & 2 values for specific users. Or switch on /off some values without accessing the database.

    Can you confirm that this question is posted to the correct forum, or if it should go into another? 
    If this is Universe Designer related, you can review your LOV's by:
    1. right-click on the object in the universe designer, and select Properties dialog
    2. Select Properties tab,
    3. Select 'Display'
    4. then shift or control select the LOV's that you want to be viewable,
    5. enable the checkmark next to 'Show Selected Only'
    6. Click OK, and then save and re-export the universe.

  • How to get a specific value from a mult-value returning procedure

    Hi,
    We're using Oracle 11.1.
    I have a procedure that I'm calling in a query that looks like the following:
       PROCEDURE tcmenc1_clean_codes (
          p_icd_code_1_source   IN     VARCHAR2,
          p_icd_code_2_source   IN     VARCHAR2,
          p_icd_code_3_source   IN     VARCHAR2,
          p_claim_code_1_src    IN     VARCHAR2,
          p_claim_code_2_src    IN     VARCHAR2,
          p_claim_code_3_src    IN     VARCHAR2,
          p_revenue_code_1_src            IN     VARCHAR2,
          p_cpt_code_1_src                IN     VARCHAR2,
          p_icd_code_1_std        OUT VARCHAR2,  <------------------------Just want this one.
          p_icd_code_2_std        OUT VARCHAR2,
          p_icd_code_3_std        OUT VARCHAR2,
          p_icd_code_1_std         OUT VARCHAR2,
          p_icd_code_2_std         OUT VARCHAR2,
          p_icd_code_3_std         OUT VARCHAR2,
          p_revenue_code_1_std               OUT VARCHAR2,
          p_hcpcs_code_std                   OUT VARCHAR2,
          p_cpt_code_std                     OUT VARCHAR2,
          p_generic_cd_std                   OUT VARCHAR2
       )I'd like to return only the p_icd_code_1_std value. how can I do this?
    Can I just use:
    PROCEDURE tcmenc1_clean_codes (input1, input2, input 3,...,
    p_icd_code_1_std => output1);Also If I don't have inputs for all my inputs, can I specify just the fields I want to input?

    I'm not sure I understand what you mean by target?
    I thought about using a function to pass parameters to this procedure and then have another input parameter that would determine
    which output parameter to use.
    I just wanted to see if there was a cleaner way to do this.

  • WebI showing random value from give prompt value

    Dear All,
    I have made an universe on top of SAP BW Query.
    I have designed webI report on top of that. In that I have "Fiscal Year.Period" as Interval Prompt in WebI not in BW Query and I can't put prompt in BW Query because based on same universe i have other report as well.
    I have user cross-tab in Report and in column section I have "Fiscal Year.period".
    Now the issue is, when I refresh document, it is asking me to enter From & To Period. I am giving input as example 001.2010 to 012.2010 then it should show me values between 001.2010 to 012.2010 only but instead it is giving me values for 2011, 2007 year as well.
    Does anyone have idea why it is happening ?
    As per my analysis, during prompt value LOV is by default sorted in Asscending order :
    1)V3/001.2010
    2)V3/001.2011
    etc.
    I really appreciate your quick input on this.
    Regards,
    Rishit

    hi ,,
    I have tried and understand your scenario....the data thing it having issue with bo .....but resolved by using this notes......
    1494404 - Using Webi query filters based on dates using "Greater than" and "Less than" and "between" does not work properly when based on SAP BEx.
    Try this and give the feed back......

  • Displaying All Values from a Multiple Value Parameter

    Hi,
    Using XI, I have a parameter field that allows the user to enter multiple values Eg. 01, 02, 13, 14.  I want to create a formula to display all the values the user has selected. 
    Is there a way to do this? 
    Thanks,
    Brian

    join({?Parameter},",")
    creates a string with the items in your parameter separated by commas

Maybe you are looking for

  • API for Desktop search

    Hi , Can some one let me know if there is any API available for searching files which contain specific words in a particular directory? My objective is to get the files that contain a string from a directory.In short it should work similar to the win

  • Startup Password unknown

    My laptop model c2l87UA#ABL boots and asks me for a startup password.  No idea what is is or why it now wants one.  I cant get past that.  Can anyone offer a password?  Tried a few mentioned in these posts with no luck. This question was solved. View

  • AS3 Dropped MovieClip doesn't take parent's dimensions

    Please help me with my code. I'm working on a map project with several movie clips that are dragged and dropped onto their respective movie clips. PROBLEM: Initially, draggable movie clips are reduced their original size. When they are dropped onto t

  • Getting Cross platform applications to work

    I want to be able to open desktop publishing files written in OpenOffice from a Windows and Linux platform. There is no problem opening the files from the Windows platform. I use: String mscommandString = "cmd /Q /C " + fileName;       try         Ru

  • How to remove a photo (of me) from outgoing mail??

    I guess when I first set up this Mac, I was enamoured of the little camera on the top of the screen and took a (really bad) pic of me and it is now attached to all my outgoing mail. I suppose I chose to do that - but now I WANT IT OFF. First, it's re