Formula for comparing dates and display data

I have 3 objects on my query: Date, Product name and Quantity sold
I have a table on my reports showing the top 3 products by quantity sold, and I want to add the quantity sold today on the same table.
I am looking for a formula that compares de dates provided by the query with current date and only displays on the cell the quantity for the current day.
Any ideas are welcome!

As per my understanding, you want to display the today's sale of the product while the ranking is aaplied on the total quantity
sold.
You can create a new variable with either of the following two definitions:
Today's Date = CurrentDate()
Today's Sale = Sum([Quantity Sold]) where ([Date]=[Today's Date])
or
Today's Sale = If(([Date]=[Today's Date]) Then Sum([Quantity Sold])
Note: The two date formats should be same.
For getting the top three products you can use the hidden column(font, border and background white) and apply the ranking on
the total sale coming from the DB.
Regards,
Rohit

Similar Messages

  • Formula for comparing string and setting text object to visable?

    I have a report that is pulling data from a database and listing multiple records, one on each page. I am wanting to compare a value that is stored in a database field for each record and setting a text object visible based on the text.
    I'm very new to Crystal Reports and not quite sure on the type of syntax needed to perform what I'd like below and can't find much information online about it. The type of formula I want would be something like:
    if (vDetailReport.BoardAction = "Board Action w/Committee Action")
        txtBox1.Visible = True;
    else if (vDetailReport.BoardAction = "Board Action w/o Committee Action")
        txtBox2.Visible = True;
    else if (vDetailReport.BoardAction = "Committee Discussion Only")
        txtBo3.Visible = True;
    etc.
    The txtBoxes are text objects with an "X" as the string that are inside the boxes to appear as a checkbox. I'm wanting this to work for every record in the report.
    Example:
    http://img.photobucket.com/albums/v57/kaje103/boardaction.png
    Any help would be much appreciated!

    I believe that what you want to do here is place an text item consisting of an "X" at each location you want. Then select "Format Text", go to the Common Tab, and click on the button next to "Suppress". That allows you to put in a formula such as:
    {vDetailReport.BoardAction} <> "Board Action w/Committee Action"
    that will suppress the X unless it's the value you want checked.

  • Create Separate Views for New,Edit and Display forms in Infopath

    Hi,
    I need to create a separate views for New, Edit and Display forms in infopath.
    For ex : I need a Submit Button on Display form and not in New/Edit forms.
    I tried, but i amnot able to get the changes.
    Regards, Shreyas R S

    I just validated my approach in a 2013 farm, this is precisely how it's done!
    Step 1) List > Display Form
    Step 2) Change the View within the Web Part Properties. In your screenshot it looks like you simply went to View Item on the single item, which is not the direction I gave =P.
    **Assuming you've already created the multiple views within InfoPath, this allows you to set them up as distinct defaults for New, Edit and Display, let's make that clear. If you are not even to the point of having separate views, that is just in InfoPath,
    Page Design tab, far left, New View button

  • Function module for comparing dates and times

    Hi,
    I have a date and time stamp in one filed for example as below:
    20070125183045
    (the first 8 are date in YYYYMMDD format, the next 6 is time in HHMMSS format). Now I want to compare this value to another such value in terms of date and time. First I want to compare dates and then times. Do you know any function module that can serve this purpose?
    Thanks very much!

    You can compare these using the function module DURATION_DETERMINE.  This fuction will give you the difference, and it can be in a view different units, such as the difference in days, months, etc.
    Funciton module takes in Start date and time and end date and time.
    Regards,
    RIch HEilman

  • Formula for compare two date fields

    Please help me,
    There are two date fields in DSO , I want to create a key figure by Query Designer, the condition as blow
    Count ( If field DateA > field DateB = 1 else 0 ).

    http://www.sd-solutions.com/SAP-HCM-BW-Replacement-Path-Variables.html
    create 2 formula varaibles like above and comapre it

  • XL reporter  - What is the formula for Comparing difference between 2 dates

    Hi,
    I would like to create an Ageing report in XL reporter for SAP business one. 
    Columns include 30 days, 60 days 90 days etc.
    What should be the formula for Column Selection for eg: 30 days?
    The logic is total the value if Today Date - Posting Date <=30.
    Appreciate any help.

    Hi Jim,
    I have started XL reporter within SAP Business One.
    On XL reporter menu, I go Help--> Help.
    The standard Help screen opened.
    I have typed in Period, Syntax Period, Date, DateAdd, but I don't seem to find the example you mentioned.
    Could you please advise me what I have missed?

  • Formula for completion date

    Need to create a formula for this..
    If a project completes on A and the date lies between B & C then "display late by 10 days"
    if a project completes on D and the date lies between E & F then "display late by 20 days"   and so on , there are 100's of projects and hundreds of completion dates.
    what would be the best approach for this?
    Any suggestions appreciated

    You really need a Project target or due date and then calculate days late
    @Late
    If completiondate > targetdate then
    datediff("d", targetdate, completiondate) else 0
    You can then do banding on this
    @overdue
    If @late = 0 then 'Not Due' else
    If @late in 1 to 9 then 'Less than 10 days overdue'
    else
    etc.
    Hope that helps
    Ian

  • Query advice for comparing data

    Looking for advice on how to create query that compares two period (Date Range of sale totals)
    Total sales for year 2007 and 2008 in two separate columns.

    You may try this one:
    SELECT T0.CardCode, T0.CardName,
    (SELECT SUM(DocTotal) FROM OINV WHERE CardCode = T0.CardCode
    AND YEAR(DocDate) = '2007') - (SELECT SUM(DocTotal) FROM ORIN
    WHERE CardCode = T0.CardCode
    AND YEAR(DocDate) = '2007')  AS [Sales 2007],
    (SELECT SUM(DocTotal) FROM OINV WHERE CardCode = T0.CardCode
    AND YEAR(DocDate) = '2008') - (SELECT SUM(DocTotal) FROM ORIN
    WHERE CardCode = T0.CardCode
    AND YEAR(DocDate) = '2008')  AS [Sales 2008]
    FROM [dbo].[OCRD] T0 LEFT JOIN [dbo].[OINV] T1 ON T1.CardCode = T0.CardCode
    WHERE T0.CardType = 'C'
    GROUP BY T0.CardCode, T0.CardName
    Thanks,
    Gordon

  • I need to get 2 decimal places when using a formula for a quotient and Numbers will only give me whole integers which is useless since most items will be less than 1. How can I change this?

    How do I get 2 decimal places when using a formula for a quotient? It only gives me whole integers. Most of the results will be less than 1 so I need 2 decimal places

    the quotient function returns only whole number portion of the dividing two numbers.  If you want the actual decimal value use the divide operator.  you enter this as:
    A/B
    if the numerator is in A1 and the denominator is in B1 you can enter the formula like this:
    =A1/B1

  • SAP HANA Cloud Portal : Make Widget For Java Application and Display in HANA Portal

    Hi Experts,
    I have created one Java Application using eclipse luno.
    I have successfully deploy on my hanatrial version and able to see the Started Application under the Java Application.
    Can anyone have idea how to use this application in HANA portal and display/ run  this Java Application in SAP HANA Cloud Portal Website.
    I want to know is it possible or not ? and yes then how its possible ?
    What are the steps require to make Widget for this java apps and publish on portal.
    Many Thanks,
    Mithun 

    Hi Mithun,
    yes it's possible and relatively easy - follow Chapter 7 of the guide -
    ESPM WebShop Extension
    Regards
      Kenny

  • What's wrong with my code for comparing date retreived from db and sysdate?

    Hi all,
    I need to retrive date from the DB and compare it to system date.i have posted the code below.i get java.sql.SQL Exception:Io exception:Socket closed.
    What's wrong with the code?please help me.Thanks in advance.
    public boolean date() throws IOException, SQLException {
    Connection con1;
    long millis = System.currentTimeMillis();
    Timestamp timestamp = new java.sql.Timestamp(millis);
    ResultSet rs4 = null;
    try
    Class.forName("oracle.jdbc.driver.OracleDriver");
    con = DriverManager.getConnection(
    "jdbc:oracle:thin:@abc:1605:xyz",
    "cdf", "cdf");
    Statement stmt_exp = con.createStatement();
    rs4 = stmt_exp.executeQuery("SELECT DATE FROM TABLE_NAME")
    while (rs4.next()) {
    Timestamp timestamp2 = rs4.getTimestamp("expire_date");
    con1.close();
    catch (Exception e)
    e.printStackTrace();
    finally
    //ResultSet rs4 = null;
    //Timestamp timestamp2;
    Timestamp timestamp2 = rs4.getTimestamp("expire_date");
    if (timestamp2.compareTo(timestamp) < 0)  //sysdate < exp date
    return true;
    } else {
    return false;
    }

    Didn't you understand what BalusC said? You're closing the connection and then trying to use the ResultSet. The ResultSet will be closed when you close the connection so you can't use it anymore.
    You should close the connection last thing in your code, probably in a finally. And after you close your ResultSet and Statement.
    People on the forum help others voluntarily, it's not their job.
    Help them help you.
    Learn how to ask questions first: http://faq.javaranch.com/java/HowToAskQuestionsOnJavaRanch
    ----------------------------------------------------------------

  • Need a formula for a date in one table to show on a calendar on a "summary" sheet

    Hello,
    I have created a simple table for my daughter to keep track of her monthly bill's due dates which are in one row of the table. I'd like to create a "summary" sheet which consists of a calendar that shows those dates at one look, it would also show which bill that is due.
    I am just beginning to learn about formulas and have created some simple ones, but this is beyond my talents!
    I would TRULY appreciate anyone's help!
    I tried to search for this subject first, so apologies if this has been answered already.

    Here is what I came up with:
    A couple things to remember:
    1. I ended up using a VERY large IF function; you can see the multi-colored line of text at the top of the above screenshot (I hope it comes thru alright)
    2. You will need to change what date is referenced in the first part of the function. In the first line of the calendar you need to reference cell A2 (as in the screenshot), but in others you will need to use the cell that contains the proper date.
    3. This does not work if you have more than one bill due on the same date. I will try and work that out.
    4. iCal would be MUCH easier. Not only can you set these due dates as recurring events, but iCal can keep things color coded, send you reminders, etc.

  • Business rule for compare data in form

    Hi all,
    Let us explain my scenario,
    I have 2 dynamic calc members in a dataform. I just want to compare those 2 member rows( data compare) and show some message.
    is there any way i can make?
    can i create one business rule to make this happend? is it possible? If its possible can you give me your thoughts on this.
    Any information would be helpful.
    Thanks in advance.

    Sorry about that . . . . I read the first post and assumed the code was related to a business rule instead of JavaScript - should have looked closer.
    I would do a couple of things:
    1) Simplify your code. Why have a separate function? Why not drop all the logic into validateForm?
    2) Why haven't you populated the app name and form name in validateForm? (sorry if I missed this in the rest of the post somewhere)
    3) Insert alerts within the code that cycles through the cells. Something like this:
    cellVal = getCellValueXY(col,row);
    alert(" Column: " + col + "\n" +
    " Row: " + row + "\n" +
    " Cell Value: " + cellVal);
    This will tell you exactly how your JavaScript is evaluating each cell. This can help when you're dealing with floating point decimal issues. (you entered 10, but it's being evaluated as 10.00000001) If this ends up being your issue (floating point issues), let me know and I'll show you how to get around this.
    If you throw enough alerts at this code, your issue will finally show itself.
    4) I wouldn't assign values to "startCol" and "numberGridCols". I believe these variables are set elsewhere in the code (not in YOUR code, but in EnterData.js or somewhere else).
    Instead, I would use my own variables
    5) I would structure the code more like this: (I haven't validated this or tested it . . . . use this for suggestion purposes only)
    function validateForm()
    var valid = true;
    var c;
    if (equalsIgnoreCase(applicationName,"PUT YOUR APP NAME HERE")) {
    if (equalsIgnoreCase(formName,"PUT YOUR FORM NAME HERE")) {
    for (c=3; c<numCols; c++) {
    if((grid23[c] != missing) || (grid24[c] != missing)) {
    var actualVal = getCellVal(23,c);
    var budgetVal = getCellVal(24,c);
    if(actualVal != budgetVal){
    valid = false;
    if (!validated) {
    alert("The numbers you have submitted for SII are not equal to Actuals. Please adjust your numbers.\n");
    return valid;
    I hope this helps. Hopefully there aren't too many bugs in this.
    - Jake

  • Create URL for image content and display in new window

    Hi,
    I am attaching a new image and it is displayed in a table view.
    I am having problems creating the URL for the image.
    When i give the link of external site like http://www.google.com, it works fine. It does not work when i give as www.google.com.
    It does not work for the image. Please help.
      ls_properties-name         = 'KW_RELATIVE_URL'.
      ls_properties-value        = lv_imgname.
      APPEND ls_properties TO lt_properties.
      ls_properties-name         = 'LANGUAGE'.
      ls_properties-value        = sy-langu.
      APPEND ls_properties TO lt_properties.
    Assign file properties
      ls_file_access_info-binary_flg = 'X'.
      ls_file_access_info-file_name  = lv_imgname.
      ls_file_access_info-mimetype   = 'image/pjpeg'.
      ls_file_access_info-property   = lv_string2.
      APPEND ls_file_access_info TO lt_file_access_info.
    Move content to file_content
      lv_str = lv_img_content.
      lv_strlen   = XSTRLEN( lv_str ).
      lv_offset   = 1022.
      lv_bytes_rd = 0.
      lv_bytes_rm = lv_strlen.
      ASSIGN lv_str TO <fs>.
      WHILE lv_bytes_rd LT lv_strlen.
        IF  lv_bytes_rm LT lv_offset.
          ls_content-line = <fs>+lv_bytes_rd(lv_bytes_rm).
        ELSE.
          ls_content-line = <fs>+lv_bytes_rd(lv_offset).
        ENDIF.
        APPEND ls_content TO lt_content.
        lv_bytes_rd = lv_bytes_rd + lv_offset.
        lv_bytes_rm = lv_strlen - lv_bytes_rd.
        CLEAR ls_content.
      ENDWHILE.
    Create a Document using class CL_CRM_DOCUMENTS
      CALL METHOD cl_crm_documents=>create_with_table
        EXPORTING
          business_object     = ls_business_object
          properties          = lt_properties
          file_access_info    = lt_file_access_info
          file_content_binary = lt_content
          raw_mode            = 'X'
        IMPORTING
          loio                = ls_loio
          phio                = ls_phio
          error               = ls_error.
    Using the logical and physical id's, get the file location as an URL
    data:
    lv_no type char1 value '1'.
        CALL METHOD cl_crm_documents=>get_with_url
          EXPORTING
            loio     = ls_loio
            phio     = ls_phio
            url_type = '2'
          IMPORTING
            error    = ls_error
            url      = lv_url1.
    should i prefix the url with 'javascript:'?
    Thanks in advance.
    Regards
    Shanthi

    Hi Shanti,
    The URLs that are external to the server, you should always have http://, your image URL is has http:// prefix? Other wise system will always look for the same inside the current BSP application. For Example your BSP application is ZBSP and if you are accessing www.google.com the URL in the browser will be
    *******/bsp/ZBSP/www.google.com which will not be existing, hence causing the problem.
    If not try adding http:// to the URL by concatenation and try.
    Regards,
    Ravi

  • NEWB HELP! How do I write Formula for Sales Tax and Gratuity items

    Sorry for the bonehead question, but I'm not much good with spreadsheets and we're trying to find out if we can afford to get MARRIED. In numbers '08, I'm using the "new from template chooser" item called "event planner".
    So far, it's adapting nicely to our needs, BUT some items incur sales tax, others do not. Some items involve a gratuity, others do not.
    I understand the idea of adding an E column with the basic formula =D*7.25% or an F column with =D*20%
    but that would add tax to EVERYTHING - question is this
    If I add two columns of checkboxes, one for YES TAX, one for YES GRATUITY
    how would I write the formula to say "If E is checked, then multiply D by 7.25%; if F is checked, then multiply D by 20%; add these two numbers together and put them in column G; if neither box is checked, put the value of D into G"
    then I could SUM column G (???)
    Thanks in advance for any help!

    Buster,
    This formula will work (long form):
    =IF(AND(B2=TRUE,C2=TRUE),A20.0725A2+0.2*A2,IF(B2=TRUE,A2+0.0725*A2,IF(C2=TRUE,A20.2A2,A2)))
    and can be simplified to:
    =IF(AND(B2=TRUE,C2=TRUE),1.275A2,IF(B2=TRUE,1.0725*A2,IF(C2=TRUE,1.2A2,A2)))
    I would point out, however, that tax rates and tip amounts tend to change. So instead of putting constant values in the formula, you may wish to replace them with cell references to the tax and tip rate values. Then should these values change, you need to change them in only one place rather than all your formulas.
    pw

Maybe you are looking for

  • How to add an order number to each page of an adobe doc?

    I have a customer that is requiring us to add their order number to every page of multipage documents we send them.  Right now we're using typewriter and pasting the order number to each page individually.  Is there an easy way to automate this proce

  • Opening a pdf document in a new window on click of commandLink in ADF

    Hi, I am having a command link in my page and on click of that i am calling a webservice and getting the contents as bytes and writing the contents to the response outputstream. And i followed the below given steps. Everything works fine and i am get

  • Pairing the iPad and the iPhone together

    I'm just trying to find out when I link my iPad and my iPhone together what I can do or is it just used for tethering ? I would like to use my iPhone as a wireless keyboard for the iPad but is this at all possible ? Any help would be very much apprec

  • Input tax credit on import

    Dear all, Why purchase of imported goods also allowed input tax credit? If purchase locally can reclaim why purchase of imported goods also can reclaim? Thanks

  • Can we edit Text ?

    I - for the life of me - can't find a way to edit text on it's layer once the check box has been clicked and the text layer is made... We can transform, size, skew etc., using the tools under the move tool icon but I can't seem to find a way to actua