August 15, 2015

How to use pivot table in msoffice excel

Working with Pivot table in microsoft office excel

The Pivot Table in Microsoft Office Excel will make you analyze and summarize a large set of data very quickly. Pivot Table is considered to be a powerful feature in Microsoft Office Excel. You can also present data in variety of ways through pivot table. Here i m sharing a MS Excel Pivot table tutorial Or the scope of Pivot table in Excel.



PIVOT TABLE :- HOW TO CONSOLIDATE OR SUMMARIZE DATA



PIVOT TABLE SAMPLE
PIVOT TABLE in EXCEL SAMPLE





Choose the table you need to summarize/analyse.

Pivot Table Data
Creating Pivot table in MS office excel

Create a pivot table for that data : - Go to Insert tab >>  Pivot Table  >>  Create Pivot Table.
A window will be open now, where you have to show the data table. (Please omit the blank column in data table)


Pivot table property window
Creating Pivot Table in M S Office Excel

Choose the data that you want to analyze.

Table / Range : You have to show the data table ( Prefer the data table with header)

Pivot table property window
Creating Pivot Table in MS Office Excel

Choose the field to add in the report : just tick on branch name and amount. A new table with a column will be created having amount under branch name.



Creating Pivot Table in MS Office Excel
Creating Pivot Table in MS Office Excel

If you need to show branch name and sum of amount in separate columns just drag the field amount from row table to sigma function area. ( dragging option in right bottom ). Now the data table will change like below.

Pivot table summarization
Creating Pivot Table in MS Office Excel


These are another types of reports created using the same data using Pivot table in Microsoft Office Excel.

Pivot table analzyse
Creating Pivot Table in M S Office Excel




pivot table report in excel
Creating Pivot Table in MS Office Excel


Author : +belazy

Hope you enjoy the code.


another pivot table example


Thanks to +Shimjith  +Vipin Cp  and +deepajayaprakash payyanakkal  for their supports

@consumerfed  +consumerfed

http://javabelazy.blogspot.in/

August 04, 2015

How to compare two pojo model objects in java based on a integer value


How to compare two pojo model objects in java based on a their value



Source code

/**
 *
 */
package com.cfed.oms;

import java.util.Comparator;
import java.util.Date;

/**
 * @author IT
 *
 */
public class BranchModel implements Comparator<BranchModel> {

private int branchId = 0;
private String branchName = null;
private int branchCode = 0;
private String category = null;
private String constituency = null;
private String address = null;
private String district = null;
private Date openingDate = null;
private Date closedDate = null;
private Long lat;
private Long lon;
private String link = null;
private String status = null;

private int branchTypeId = 0;
private String branchTypeName = "zo";
private String branchReportingOffice = "ho";
private int branchTypeHirerachy = 2;
private String branchTypeStatus = "Y";
private String branchTypeDesc = "testing";

private int branchSale = 0;

public Long getLat() {
return lat;
}
public void setLat(Long lat) {
this.lat = lat;
}
public Long getLon() {
return lon;
}
public void setLon(Long lon) {
this.lon = lon;
}


public int getBranchId() {
return branchId;
}
public void setBranchId(int branchId) {
this.branchId = branchId;
}
public String getBranchName() {
return branchName;
}
public void setBranchName(String branchName) {
this.branchName = branchName;
}
public int getBranchCode() {
return branchCode;
}
public void setBranchCode(int branchCode) {
this.branchCode = branchCode;
}
public String getCategory() {
return category;
}
public void setCategory(String category) {
this.category = category;
}
public String getConstituency() {
return constituency;
}
public void setConstituency(String constituency) {
this.constituency = constituency;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public String getDistrict() {
return district;
}
public void setDistrict(String district) {
this.district = district;
}
public Date getOpeningDate() {
return openingDate;
}
public void setOpeningDate(Date openingDate) {
this.openingDate = openingDate;
}
public Date getClosedDate() {
return closedDate;
}
public void setClosedDate(Date closedDate) {
this.closedDate = closedDate;
}

public String getLink() {
return link;
}
public void setLink(String link) {
this.link = link;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}


/**
* @return the branchTypeId
*/
public int getBranchTypeId() {
return branchTypeId;
}
/**
* @param branchTypeId the branchTypeId to set
*/
public void setBranchTypeId(int branchTypeId) {
this.branchTypeId = branchTypeId;
}
/**
* @return the branchTypeName
*/
public String getBranchTypeName() {
return branchTypeName;
}
/**
* @param branchTypeName the branchTypeName to set
*/
public void setBranchTypeName(String branchTypeName) {
this.branchTypeName = branchTypeName;
}
/**
* @return the branchReportingOffice
*/
public String getBranchReportingOffice() {
return branchReportingOffice;
}
/**
* @param branchReportingOffice the branchReportingOffice to set
*/
public void setBranchReportingOffice(String branchReportingOffice) {
this.branchReportingOffice = branchReportingOffice;
}
/**
* @return the branchTypeHirerachy
*/
public int getBranchTypeHirerachy() {
return branchTypeHirerachy;
}
/**
* @param branchTypeHirerachy the branchTypeHirerachy to set
*/
public void setBranchTypeHirerachy(int branchTypeHirerachy) {
this.branchTypeHirerachy = branchTypeHirerachy;
}
/**
* @return the branchTypeStatus
*/
public String getBranchTypeStatus() {
return branchTypeStatus;
}
/**
* @param branchTypeStatus the branchTypeStatus to set
*/
public void setBranchTypeStatus(String branchTypeStatus) {
this.branchTypeStatus = branchTypeStatus;
}
/**
* @return the branchTypeDesc
*/
public String getBranchTypeDesc() {
return branchTypeDesc;
}
/**
* @param branchTypeDesc the branchTypeDesc to set
*/
public void setBranchTypeDesc(String branchTypeDesc) {
this.branchTypeDesc = branchTypeDesc;
}
public void setBranchSale(int branchSale) {
this.branchSale = branchSale;
}
public int getBranchSale() {
return branchSale;
}
@Override
public int compare(BranchModel branch1, BranchModel branch2) {
// TODO Auto-generated method stub
double sale1 = branch1.getBranchSale();
double sale2 = branch2.getBranchSale();
return (int) (sale1 - sale2);
}





}


Main class

/**
 * 
 */
package com.cfed.oms;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 * @author nijesh
 *
 */
public class ComparatorSortClass {

/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
BranchModel branchModel = new BranchModel();
BranchModel branchModel1 = new BranchModel();
BranchModel branchModel2 = new BranchModel();
BranchModel branchModel3 = new BranchModel();
branchModel.setBranchName("TSM Nadapuram");
branchModel1.setBranchName("TSM Nadakkavu");
branchModel2.setBranchName("TSM Muthalakulam");
branchModel3.setBranchName("TSM Balussery");
branchModel.setBranchSale(500);
branchModel1.setBranchSale(1000);
branchModel2.setBranchSale(200);
branchModel3.setBranchSale(450);
List branchLists = new ArrayList();
branchLists.add(branchModel);
branchLists.add(branchModel1);
branchLists.add(branchModel2);
branchLists.add(branchModel3);
Collections.sort(branchLists);

}

}



http://javabelazy.blogspot.in/

Facebook comments