How can I compare

Hi ,]
I have this program called HugeIntegerTest with a constrcutor HugeInteger. In the constructor i have this method
public boolean isEqualTo(HugeInteger num2) {
    int tempNum[] = num2.getNum();
    boolean retval = true;
    for (int i = 0; i < SIZE; ++i){
      if (num[i] != tempNum){
retval = false;
break;
return retval;
And in the main program i have so far, i am new to this and i am a bit confused
public class HugeIntegerTest{
  public static void main(String args[]) {
        int p[]={1,3,5,6,5,4,6,8,7,6,2,1,6};
        HugeInteger h1 = new HugeInteger(p);
        int t[]= {1,6,5,7,9,5,4,8,6,3,1,2,8,7,4,1};
        HugeInteger h2= new HugeInteger(t);
        System.out.println(h1);
        System.out.println(h2);
}My question is, how can i create the loop so that it will use the isequal method i have and it compares the two arrays and i can print those numbers that are equal?.
Your help is very much appreciated
Regards
Ed

METHODS
public class HugeInteger{
  private int SIZE=40;
  private int num[]=new int[SIZE];
    public HugeInteger(int val[]) {
      setNum(val);
    public HugeInteger(String s) {
      setNum(s);
    public int[] getNum(){
      return num;
    public void setNum(int val[]) {
      int pos=SIZE-1;
        for(int i=val.length-1;i>=0;i--) {
          num[pos]=val;
pos--;
public void setNum(String s) {   
int pos=SIZE-1;
for(int i=s.length()-1;i>=0;i--) {
num[pos]=(int) s.charAt(i)-48;
pos--;
//set the front part to all 0's
for(int j=pos; j>=0;j--){
num[j]=0;
public String toString() {
String s="";
for(int i=0;i<num.length;i++) {
s=s+num[i];
return s;
public boolean isEqualTo(HugeInteger num2) {
int tempNum[] = num2.getNum();
//boolean retval = true;
for (int i = 0; i < SIZE; ++i){
if (num[i] != tempNum[i]){
return false;
//retval = false;
//break;
return true;
The above constructor works, now the problem is in the main, i need a For loop that compares both arrays by object and tells me if its equal i have tried without luck. So far i got this
public class HugeIntegerTest{
  public static void main(String args[]) {
      HugeInteger h1 = new HugeInteger("1356546876216");
        int t[]= {1,6,5,7,9,5,4,8,6,3,1,2,8,7,4,1};
        HugeInteger h2= new HugeInteger(t);
        System.out.println(h1);
        System.out.println(h2);
}Thanks for your time :)

Similar Messages

  • How can I compare the actual and expected values in Unit testing when they are XML files?

    I have created a unit test for a method in VS 2008. My expected value and actual value are XMLs. Therefore though the output is same as I expect it gives an error as I am doing string comparison now. How can I compare these 2 XMLs in expected output and
    actual output format in Unit Testing?
    mayooran99

    In unit test, when you want to validate XML files, you feed them into the class / struct that you want to feed the XML into and compare the values there (You don't just feed it in XMLReader and feed it line by line, right? But if it really is, that's how
    you should also test it in unit tests).
    In short, how you'd use the XML in your code, that's how you should test it in unit test.

  • HT1209 My Itunes Library and iPhone have fallen out of sync on music over the yearsare - how can I compare my itunes library with my Iphone  to see what songs are missing from my library so I can then bring my Library up to date

    My Itunes Library and iPhone have fallen out of sync on music over the yearsare - how can I compare my itunes library with my Iphone  to see what songs are missing from my library so I can then bring my Library up to date

    Hello Solid Buck,
    Thank you so much for providing the details about the duplicate song issue you are experiencing.  It sounds like you would like to remove the duplicate songs that will not play on your iPhone, but when you connect it to iTunes, iTunes only shows you one copy of the song on your iPhone. 
    In this situation, I recommend deleting the individual songs that do not play directly from your iPhone.  I found the steps to do this on page 61 of the iPhone User Guide (http://manuals.info.apple.com/en_US/iphone_user_guide.pdf):
    Delete a song from iPhone: In Songs, swipe the song, then tap Delete.
    Thank you for using Apple Support Communities.
    Best,
    Sheila M.

  • How can I compare more than two VIs at a same time in labview 2009

    How can I compare more than two VIs at the same time. I am an Lab Engineer I have to check assignments submitted by students and I want to know how many of them are copied from each other. Labview compare VI can only compare two VI at a time while I want to check about 30 VIs at same time.
    Regards,

    I'm not aware of a tool to compare multiple VIs.  If you don't find anything, consider posting this to the LabVIEW Idea Exchange to expose this idea directly to NI R&D.
    Thanks!
    - Greg J

  • I would like to know how can i compare a switch case 1 and case 2 in C# is it possible to do that? obs i am a begginer :)

    i would like to know how can i compare a switch case 1 and case 2 in C# is it possible to do that? obs i am a begginer :) I tried to do it with search and sort but it did not go well

    let me give you an example if you add a word case 1( lagg ord) how can i compare that word with case 2 words ( in case 2  already exist 5 words)
    here is the my program 
    using System;
    namespace ConsoleApplication1
        class Program
            static void Main(string[] args)
                //Meny
                Console.WriteLine("\n HÄNGA GUBBE\n");
                Console.WriteLine(" 1) Lägg till ord");
                Console.WriteLine(" 2) Lista alla ord");
                Console.WriteLine(" 3) Spela");
                Console.WriteLine(" 4) Avsluta");
                bool utgång = false;
                do
                    int Valet;
                    Console.Write("\n\tVälj 1-4: \n ");
                    try
                        Valet = int.Parse(Console.ReadLine());
                    catch (Exception)
                        Console.WriteLine("Du skriver fel character!\n" +
                            "\nSkriv bara mellan 1 och 4");
                        continue;
                    switch (Valet)
                        case 1:
                            Console.WriteLine("\n lägg ett till ord! ");
                          var input = Console.ReadLine();
                            break;
                        case 2:
                            Console.WriteLine("\n Lista med alla ord :\n");
                            string[] array = { " Lev", " Skratta", " Gledje", " Gråt", " Njut" };
                            Array.Sort<string>(array);
                            foreach (var c in array)
                                Console.WriteLine(c);
                            Console.WriteLine("\n");
                            break;
                        case 3:
                            string guesses, bokstäver;
                            Console.Write("\n Hur många fel får man ha? ");
                            guesses = (Console.ReadLine());
                            Console.WriteLine(" Utmärkt, då spelar vi!\n");
                            Console.WriteLine(" Felgisningar :" + "0/" + guesses);
                            Console.Write(" Gissade bokstäver ");
                            bokstäver = (Console.ReadLine());
                            Console.WriteLine("Aktuellt ord");
                            Console.Write("Gissa bokstav : " + bokstäver + " \n");
                            break;
                        case 4:
                            Console.WriteLine("\n  HEJ DÅ! \n");
                            Console.Beep();
                            utgång = true;
                            break;
                        //avbryter while loopen, avslutar spelet
                } while (!utgång);

  • How can i compare:  java.util.Date oracle.jbo.domain.Date?

    I have made a ViewObject wich contains a date column.
    I want to check if this date is smaller/greater than sysdate:
    i get following error:
    Error(45,24): method <(java.util.Date, oracle.jbo.domain.Date) not found in class Class4
    code:
    SimpleTimeZone pdt = new SimpleTimeZone(-8 * 60 * 60 * 1000, ids[0]);
    // set up rules for daylight savings time
    pdt.setStartRule(Calendar.APRIL, 1, Calendar.SUNDAY, 2 * 60 * 60 * 1000);
    pdt.setEndRule(Calendar.OCTOBER, -1, Calendar.SUNDAY, 2 * 60 * 60 * 1000);
    // create a GregorianCalendar with the Pacific Daylight time zone
    // and the current date and time
    Calendar calendar = new GregorianCalendar(pdt);
    Date trialTime = new Date();
    calendar.setTime(trialTime);
    (VO_ULNRow)singleRow = null;
    while(vo.hasNext()){                                             // ViewObject vo;
    singleRow = (VO_ULNRow)vo.next();
    if(calendar.getTime() < singleRow.getEO_ULN_BORROWFROM()); //singleRow returns oracle.jbo.domain.Date
    etcetera
    how can i compare those 2?

    Hi,
    oracle.jbo.domain.Date has two methods which suit your needs
    longValue() which returns a long (though I'm not sure if returns a long comparable to the long returned by java.util.Date)
    and dateValue() which returns a java.util.Date
    I hope it helps,
    Giovanni

  • Java.util.Date oracle.jbo.domain.Date how can i compare?

    I have made a ViewObject wich contains a date column.
    I want to check if this date is smaller/greater than sysdate:
    i get following error:
    Error(45,24): method <(java.util.Date, oracle.jbo.domain.Date) not found in class Class4
    code:
    SimpleTimeZone pdt = new SimpleTimeZone(-8 * 60 * 60 * 1000, ids[0]);
    // set up rules for daylight savings time
    pdt.setStartRule(Calendar.APRIL, 1, Calendar.SUNDAY, 2 * 60 * 60 * 1000);
    pdt.setEndRule(Calendar.OCTOBER, -1, Calendar.SUNDAY, 2 * 60 * 60 * 1000);
    // create a GregorianCalendar with the Pacific Daylight time zone
    // and the current date and time
    Calendar calendar = new GregorianCalendar(pdt);
    Date trialTime = new Date();
    calendar.setTime(trialTime);
    (VO_ULNRow)singleRow = null;
    while(vo.hasNext()){ // ViewObject vo;
    singleRow = (VO_ULNRow)vo.next();
    if(calendar.getTime() < singleRow.getEO_ULN_BORROWFROM()); //singleRow returns oracle.jbo.domain.Date
    etcetera
    how can i compare those 2?

    i get following error:
    Error(45,24): method <(java.util.Date,
    oracle.jbo.domain.Date) not found in class Class4
    if(calendar.getTime() <
    singleRow.getEO_ULN_BORROWFROM()); //singleRow returns
    oracle.jbo.domain.Date
    how can i compare those 2? You cannot compare these two values directly. You must convert the oracle.jbo.domain.Date object to a GregorianCalendar object. Something like:
      oracle.jbo.domain.Date dt = singleRow.getEO_ULN_BORROWFROM();
      GregorianCalendar gc = new GregorianCalendar(dt.getYear(), dt.getMonth(), dt.getDay());
      if (calendar.getTime() < gc.getTime())
      }

  • How can I compare a (partial) export folder from iPhoto to an event in iPhoto to find images not exported?

    How can I compare a (partial) export folder from iPhoto to an event in iPhoto to find images not exported?  Or better yet, how can I export selected events to a new iPhoto library or an existing iPhoto library with events, titles and keywords intact?

    Ask here:
    https://discussions.apple.com/community/ilife/iphoto

  • How can i compare the contents of two folders ?

    how can i compare the contents of two folders and find out which files are in one but not in the other?? Knowing how to do this would be the best thing ever, especially when dealing with a large number of files. Often, for instance, I'm dealing with a large number of images, processing them, and saving the retouched ones to a new folder, and need to check that they are all there. If there are say three files missing in the second folder (out of say a hundred in total) being able to automate the process of elimination would be very useful. Please help!!!
    B

    I really wish I knew the answer to this. I work between two macs, a G5 and MacBook Pro when I'm on the go. Each time I move from one to the other I have to copy all my files to the computer I'm going to work on, so I end up with the same files being duplicated. It's not a problem if it's not much data but in my case the it can be to 30GB, mostly graphics files, photoshop, motion, final cut pro, etc.
    There's has got to be a way automator can make a comparison between two folders to sort out what's changed and what's remained the same. It would be nice also if this feature could be done globally on the hard disk using spotlight's technology to stop files being duplicated in places you didn't even know about and taking up valuable disk space. I'm not sure how this could be done.
    Any bright ideas Apple?

  • How can I compare two summary field in cross-tab?

    <p>Dear expert:</p><p>I have one question for how can I compare two summary field in cross-tab?  I have following cross-table:</p><p>Type          Sector1     Sector2    Sector3       Total </p><p>Outlook         10            11           9              30         </p><p>Target            5              3           1               9</p><p>I want to compare the summary field(total) relationship percent, I want to get "9/30". Someone told me I must create the DB view or table via SQL, then can implete in Crystal Report. Can I implete it in Crystal Report via fomula or other function?</p><p>Thanks so much for your warm-hearted help!</p><p>Steven</p>

    Hello Steven, yes you can compare summary fields, If you are comparing Summary to Target, or vice versa - you can do it within Crystal Reports.
    1. In Suppress conditional formula, create 2 Global variables: CurrentOutlook and CurrentTarger and get the current value.
    2. In Display String formula for Total show ToText(CurrentTarget/CurrentOUtlook) + "%".
    For more difficult cases of compariing fields in cross--tab, you may look into http://www.relasoft.net/KB10001.html.
    Best,
    Alexander

  • How can i compare in percentage, vowels and consonants in english and german language?

    how can i compare in percentage, vowels and consonants in english and german language?

    Hi,
    Try comparing the Unicode value of the characters, see the code samples in these threads:
    Generating unicode
    for arabic character similar to Character map in c#
    How
    do you get the numeric unicode value of a  character?
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How can i compare the character fields?

    I have a requirement to compare the character fields .
    I have to compare the 2 character fields of a table CDPOS
    As follows .
      If CDPOS-VALUE-OLD  GT  CDPOS-VALUE-NEW
          Populate    REDATED = ‘YES’.
    ELSE
          Populate  REDATED = ‘NO’.
    My doubt here is how can we compare the character fields.?
       When I do Extended Program Check: I am getting error like this ?
    Greater than/less than comparisons with character type operands may not be portable
    Please give me idea .
    Thanks ,
    Suresh Kumar.

    Hi suresh,
    DATA : a TYPE char10  VALUE 'DBCD',
           b TYPE char10  VALUE '4234',
           c TYPE char10  VALUE '3456',
           d TYPE char10  VALUE 'ADA',
           e TYPE char10 VALUE  '234567'.
    IF b GT c.        "this case checks for numeric values
      WRITE :/ 'B is bigger'.
    ELSE.
      WRITE :/ 'C is bigger'.
    ENDIF.
    IF a GT d.      "this case checks for alphbetical order
      WRITE :/ 'A is bigger'.
    ELSE.
      WRITE :/ 'D is bigger'.
    ENDIF.
    IF strlen( a ) GT strlen( d ). "this case checks for no of chars
      WRITE :/ 'A is bigger'.
    ELSE.
      WRITE :/ 'D is bigger'.
    ENDIF.
    IF a GT c.      "this case first alph then numerics
      WRITE :/ 'A is bigger'.
    ELSE.
      WRITE :/ 'D is bigger'.
    ENDIF.

  • Mysql datetime datatype, from that datetime how can i compar only time part

    Hello i have database table in mysql, there is Datetime datatype column, from that datetime how can i compare only time part .....??
    Thanks in advance...

    Note you can't simply just compare time via equality however.
    Timestamp resolution is to the second or even milli-second. No user wants to match a time to an exact millisecond.
    What they want is something like a match by hour - for example returning the number of transactions that happened from 1pm to 2pm. Even that isn't completely correct because then you need to consider whether 1pm and/or 2pm is inclusive or exclusive. Normally one end will be inclusive and the other exclusive.
    So first you need to define what the period is.
    Then construct the range.
    Then pass the range and, as already mentioned, use specific functions to handle the extraction of the time.

  • How can i compare two databases and their tables

    i have a text.txt file then
    i will insert it into db_header and db_details
    db_header has tbl_pcountheader with fld_Rack_No(char) PK and fld_DateAdded(date) PK
    db_details has tbl_pcountdetails with fld_Rack_No(char) PK, fld_Barcode(char) PK and fld_Quantity(int)
    then i will lookup in db_products
    db_products has tbl_products and tbl_barcodes
    tbl_products has fld_ItemCode
    tbl_barcodes has fld_Barcode and fld_ItemCode
    now i want to make a prompt contains
    Rack No: Date:
    Counter No:
    Barcode | Item Code | Item Description | Quantity
    how can i fill up this by comparing db_details and db_products?
    Private Sub bt_upload_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bt_upload.Click
    If saveCheckBox.Checked = False Then
    MsgBox("Please click the box to continue.")
    Return
    End If
    If lb_file.SelectedItem Is Nothing Then
    MessageBox.Show("Please select a file.")
    Exit Sub
    End If
    ' Obtain the file path from the list box selection.
    Dim filePath = lb_file.SelectedItem.ToString
    ' Verify that the file was not removed since the Browse button was clicked.
    If System.IO.File.Exists(filePath) = False Then
    MessageBox.Show("File Not Found: " & filePath)
    Exit Sub
    End If
    ' Obtain file information in a string.
    Dim fileInfoText As String = GetTextForOutput(filePath)
    'LookUP db_header, db_details and db_products
    Dim cs As String = "Database=;Data Source=localhost;" _
    & "User Id=root;Password=1234"
    Dim conn As New MySqlConnection(cs)
    Dim ds As New DataSet
    Dim da As New MySqlDataAdapter
    Dim cmd As New MySqlCommand
    Dim dt As New DataTable
    Dim stm As String = "SELECT tbl_pcountheader.fld_Rack_No, tbl_pcountheader.fld_DateAdded, tbl_pcountdetails.fld_Barcode, tbl_products.fld_ItemCode, tbl_products.fld_ItemDesc, tbl_pcountdetails.fld_Quantity FROM db_header.tbl_pcountheader INNER JOIN db_details.tbl_pcountdetails ON db_details.tbl_pcountdetails.fld_Rack_No = db_header.tbl_pcountheader.fld_Rack_No INNER JOIN db_products.tbl_barcodes ON db_details.tbl_pcountdetails.fld_Barcode = db_products.tbl_barcodes.fld_Barcode INNER JOIN db_products.tbl_products ON db_products.tbl_barcodes.fld_ItemCode_fk = db_products.tbl_products.fld_ItemCode GROUP BY tbl_pcountheader.fld_Rack_No, tbl_pcountheader.fld_DateAdded ORDER BY tbl_pcountheader.fld_Rack_No"
    ds = New DataSet
    Try
    conn.Open()
    da = New MySqlDataAdapter(stm, conn)
    da.Fill(ds, "tbl_pcountheader")
    DataGridView1.DataSource = ds.Tables("tbl_pcountheader")
    Dim headers = (From header As DataGridViewColumn In DataGridView1.Columns.Cast(Of DataGridViewColumn)() _
    Select header.HeaderText).ToArray
    Dim rows = From row As DataGridViewRow In DataGridView1.Rows.Cast(Of DataGridViewRow)() _
    Where Not row.IsNewRow _
    Select Array.ConvertAll(row.Cells.Cast(Of DataGridViewCell).ToArray, Function(c) If(c.Value IsNot Nothing, c.Value.ToString, ""))
    Using sw As New IO.StreamWriter("c:\report.txt", append:=True)
    sw.WriteLine(String.Join(",", headers))
    For Each r In rows
    sw.WriteLine(String.Join(",", r))
    Next
    End Using
    ds.WriteXmlSchema("Sample.xml")
    Dim cr As New CrystalReport1()
    cr.SetDataSource(ds)
    CrystalReportviewer1.ReportSource = cr
    CrystalReportviewer1.Refresh()
    Catch ex As MySqlException
    MsgBox("Error: " & ex.ToString())
    Finally
    conn.Close()
    End Try
    ' Show the file information.
    Dim PrintPrompt As String
    PrintPrompt = MsgBox(fileInfoText, MsgBoxStyle.YesNo, "ProofList")
    If PrintPrompt = vbYes Then
    'fileInfoText.print()
    If saveCheckBox.Checked = True Then
    ' Place the log file in the same folder as the examined file.
    Dim bakFolder As String = System.IO.Path.GetDirectoryName(filePath)
    Dim bakFilePath = System.IO.Path.Combine(bakFolder, "back-up.bak")
    Dim bakText As String = "Backed-Up: " & Date.Now.ToString & vbCrLf & fileInfoText & vbCrLf & vbCrLf
    ' Append text to the log file.
    'System.IO.File.AppendAllText(bakFilePath, bakText)
    My.Computer.FileSystem.WriteAllText(bakFilePath, bakText, append:=True)
    'My.Computer.Network.UploadFile(bakFilePath, "C:\Documents and Settings\SAPC-TECH\My Documents\back-up file.bak", "", "", False, 1000)
    'My.Computer.FileSystem.DeleteFile(bakFilePath)
    'Form2.Show()
    End If
    'Note: This message box shows that you've uploaded a file and back up it.
    MessageBox.Show("Already backed-up to ")
    Else
    'Me.Close()
    'Application.Exit()
    'End
    End If
    'Me.DialogResult = System.Windows.Forms.DialogResult.Cancel
    'Form2.Close()
    'Me.Close()
    End Sub
    here's my final code that solves my problem.
    i just make the environment of vb into mysql console
    so that i can call all the database that i wanted.

    Private Sub bt_upload_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bt_upload.Click
    If saveCheckBox.Checked = False Then
    MsgBox("Please click the box to continue.")
    Return
    End If
    If lb_file.SelectedItem Is Nothing Then
    MessageBox.Show("Please select a file.")
    Exit Sub
    End If
    ' Obtain the file path from the list box selection.
    Dim filePath = lb_file.SelectedItem.ToString
    ' Verify that the file was not removed since the Browse button was clicked.
    If System.IO.File.Exists(filePath) = False Then
    MessageBox.Show("File Not Found: " & filePath)
    Exit Sub
    End If
    ' Obtain file information in a string.
    Dim fileInfoText As String = GetTextForOutput(filePath)
    'LookUP comparison db_details to db_products
    'Dim connString As String = "Database=db_products;Data Source=localhost;" & "User Id=root;Password=1234"
    'Dim conn As New MySqlConnection(connString)
    'Dim cmd As New MySqlCommand()
    'Try
    ' conn.Open()
    ' cmd.Connection = conn
    ' cmd.CommandText = "SELECT Database1.dbo.TableName.ColumnName, Database2TableName.Name, 'The reason why Database 2 isnt defined is the fact that it has been defined in the connection" _
    ' FROM Database2TableName INNER JOIN _
    ' Database2TableName2 INNER JOIN _
    ' WHERE (Database1.dbo.TableName.ColumnName = '')"
    ' cmd.Prepare()
    ' cmd.ExecuteNonQuery()
    ' conn.Close()
    'Catch ex As Exception
    'End Try
    ' Show the file information.
    Dim PrintPrompt As String
    PrintPrompt = MsgBox(fileInfoText, MsgBoxStyle.YesNo, "ProofList")
    If PrintPrompt = vbYes Then
    'fileInfoText.print()
    If saveCheckBox.Checked = True Then
    ' Place the log file in the same folder as the examined file.
    Dim bakFolder As String = System.IO.Path.GetDirectoryName(filePath)
    Dim bakFilePath = System.IO.Path.Combine(bakFolder, "back-up.bak")
    Dim bakText As String = "Backed-Up: " & Date.Now.ToString & vbCrLf & fileInfoText & vbCrLf & vbCrLf
    ' Append text to the log file.
    'System.IO.File.AppendAllText(bakFilePath, bakText)
    My.Computer.FileSystem.WriteAllText(bakFilePath, bakText, append:=True)
    'My.Computer.Network.UploadFile(bakFilePath, "C:\Documents and Settings\SAPC-TECH\My Documents\back-up file.bak", "", "", False, 1000)
    'My.Computer.FileSystem.DeleteFile(bakFilePath)
    Form2.Show()
    End If
    'Note: This message box shows that you've uploaded a file and back up it.
    MessageBox.Show("Already backed-up to ")
    Else
    Me.Close()
    Application.Exit()
    End
    End If
    Me.DialogResult = System.Windows.Forms.DialogResult.Cancel
    Form2.Close()
    Me.Close()
    End Sub
    here's my code wherein i have to compare the two database and save it into .txt file
    i just have to get this items
    Rack No:
    Date:
    Counter No:
    Barcode:
    Item Code:
    Item Description:
    Quantity:
    as a prooflist to be print out.

  • How can I compare two periods in a report based on parameters

    Hi all,
    I'm wondering how can I create a matrix report which compares the sales of two periods. These periods are variable and coming from the parameter section that the user is using. For example, I have got the following table "Sales". Columns are:
    ID (not visible in report, can be used to lookup)
    Country
    Customer
    Year
    Quarter
    Month
    Gross sales
    The output that I would like to get is the following
    Parameter period 1: 2013 Q1
    Parameter period 2: 2013 Q3
    The report should look something like this:
                                          2013 Q1         
    2013 Q3
    USA                Microsoft         50000          75000
    So in the third column you'll see the sales based on parameter period 1, and the fourth column shows the sales based on parameter period 2.
    Thanks for the help!

    Just to be sure I understand...
    You have 1 primary dataset that returns records that will be displayed in a tablix in your report. The data will include sales information records from various years, quarters, etc. You want your report user to be able to select 2 sets of data for comparison
    based on quarter. Is this correct?
    To do this, start by adding a Matrix to the report. Set the Column Group to group on the expression:
    =CStr(Fields!Year.Value)+" "+Fields!Quarter.Value
    Set this same formula as the group header. Now Set the existing Row Group to group on Customer. Add a parent group above this Row Group and group on Country. In the detail cell set the value to:
    =Sum(Fields!GrossSales.Value)
    You will also need to access the tablix properties and set a filter as follows:
    Expression: =CStr(Fields!Year.Value)+" "+Fields!Quarter.Value
    Operator: In
    Value: @Quarters
    For this filter to work, you will need to create the @Quarters parameter as follows:
    On General tab:
    Name - Quarters
    Prompt - Select Quarters to Compare
    Data type - Text
    Allow multiple values - Checked
    Visible - Selected
    Available Values:
    Get values from query - Selected
    Dataset - dsQuarters
    Value field - YearQuarter
    Label field - YearQuarter
    Default Values:
    No default value - Selected
    Advanced: Leave at default settings
    For the parameter to work you need to create the dsQuarters dataset. This dataset needs to return a single column of distinct values for Year + " " + Quarter based on the same query that you use for your primary dataset. Add the distinct keyword (if using
    TSql) or equivelent and eliminate all of the unnecessary columns. Set it to return Year + " " + Quarter AS YearQuarter.
    Let me know if you have questions or if I missed something.
    "You will find a fortune, though it will not be the one you seek." -
    Blind Seer, O Brother Where Art Thou
    Please Mark posts as answers or helpful so that others may find the fortune they seek.

  • How can i compare the values of the objects in a class?

    hi ,
    i am testing how to test the values of the two objects
    this is the code i have return below.....
    class Sample{
              String name;
              int age;
              Sample(String name,int age){
                   this.name=name;
                   this.age=age;
    public class sample2{
              public static void main (String []arg){
                   Sample one = new Sample("cat",20);
                   Sample two = new Sample("cat",20);
    how can i test that object one and two are equal.
    can anyone clarify me about this?

    hansbig wrote:
    Um, this part doesn't work, it will never return true.
      public boolean equals(Object obj) {
    if (obj == this) {
    return true;
    It will :) try for example objectOne.equals(objectOne); and add a System.out.println() at that part. It will return there.
    >
    but this part, woah dude, that's some pretty slick code you got here:
    I couldn't figure out how to do the compare inside the class, but I think I see how this works.
    Not sure how I would do it for an object with more than one value to check though.
        if (obj instanceof EqualsExample) {               //Not the best implementation considering possible subclasses but the easiest.
    EqualsExample temp = (EqualsExample) obj;
    return (this.name.equals(temp.name)); //Always use the equals function when comparing strings!
    } else {
    return false;
    You could add them in one massive return (this.something == temp.something && etc). Or you could split it in a series of if statements. It's really dependant on what kind of variables there are in your class.
    Maybe you have an ArrayList you need to compare but also an id. then it would make more sense to check the id first and then possibly loop through the arraylist.
    Hope it's a bit more clear :)
    Edited by: hms on Jan 16, 2008 11:25 AM

Maybe you are looking for

  • How to connect apple tv to NAD T748 AV Receiver

    Hi All, Trying to connect apple tv to NAD T748 home theatre. Any one achieved this?

  • Update the values in the table on select of a particular row

    hi I want to update the values in the table on selecting the particular row. im able to select the particular row using Leadselect. can any one help me in updating the values in the table? regards raji

  • [SOLVED] mysql upgrade stops mythtv working

    Just upgraded mysql and got the following message from pacman: [2009-11-18 10:19] >> MySQL configuration file now is into /etc/mysql/ directory. [2009-11-18 10:19] >> Remember to replace it with your old configuration file. [2009-11-18 10:19] upgrade

  • Remove the line in component af:panelHeader

    How can I remove the line that comes by default with the component <af:panelHeader>? How to apply custom background color to the panel? For example: <af:panelBox styleClass="panelClass"  rendered="true" width="100%"     background="medium" id="pbBasi

  • SE11 vs. DD03L

    Dear All, I'm searching for answer concerning this: Using SE16 + DD03L and using selection criterium table LBBIL_INVOICE I can see fields (e.g. LBBIL_INVOICE-ALAND, LBBIL_INVOICE-BIL_CAT, etc.) in the report that are not displayed when I'm using SE11