Help with pivot tables in excel
Hello,
I need some help with a very specific issue I am getting in excel.
So, I have this pivot table that gets data from an external source (a huge database) and everything is working fine.
The problem comes with some lines in our database that are written in asian letters (the thai alphabet). Every thai entry that we import appears like ????????.
I can look into the DB (via MySQL Workbench) and everything is alright in there. I can also just copy some of the content into excel and the letters shows up normally.
Is there something I can do to fix it?
Thank you very much
Daniel Ayres
I can see it is working fine for roman/latin characteres, and it is not working for thai or japanese characteres. Since I dont have data written using the russian or the arabic alphabet, there is no way I can tell you if it would or not work..
Similar Messages
-
Require help with Pivot table query in SQL Server 2008
Hi,
I have a query regarding converting columns to rows in SQL Server 2008. Please look at the table below.
I need the output to look something like this :
The columns for the children can be dynamic or fixed ( max of 6 children) based on the Family_ID. For Example: A family can have 1 child or more than 1 child.
Not sure how to go about it. Would appreciate your help :)Looks like you need dynamic pivot on multiple columns. I have two articles on this topic, start from this one
T-SQL:
Dynamic Pivot on Multiple Columns
It has reference to my other blog post.
For every expert, there is an equal and opposite expert. - Becker's Law
My blog
My TechNet articles -
I'm trying to create an airplane seat map. 2 tables boarding and seats, boarding has the seat assignment (seatid) and seats has the id as well as row (eg 1) and position (eg A, B,C). I'm trying to pivot the two together so I see which seat
is taken and which is open (1-taken, 0-open). Result should look like this:
Row |A|B|C|
___1|1 0 1
___2|0 0 0
___3|0 0 0
___4|1 0 0
Using SQL server, run a below query get error "incorrect synatx near 'PIVOT'
SELECT *
FROM (SELECT s.row, s.position,
CASE when b.seatid is null
then 0
else 1
end seat_free
from seats s
left outer join
boarding b
on (b.seatid=s.id)
PIVOT (max (seat_free)
FOR position in ('A' as A, 'B' as B, 'C' as C))
Order by s.row
Thanks for the help!Hi,
in addition to pivot solutions posted by RSingh and Latheesh, you can use another solution without pivot:
select roww,MAX([A]) as [B],MAX([B]) as [A],MAX([C]) as [C]
from (
select roww ,
[A] = CASE
when position = 'A' and not ISNULL(boarding.seatid, '0') = '0' then 1
else 0
END,
[B] = CASE
when position = 'B' and not ISNULL(boarding.seatid, '0') = '0' then 1
else 0
END,
[C] = CASE
when position = 'C' and not ISNULL(boarding.seatid, '0') = '0' then 1
else 0
END
from seat
left join boarding on seat.id = boarding.seatid
) T
group by roww
Hope this is helpful :-)
[Personal Site] [Blog] [Facebook] -
How to make a Crystal Report look similar to a pivot table in excel?
Hello,
I was wondering if there was a way to create a pivot table to look similar to a pivot table in excel? I have a client name field that I would like to be expandable(similar to pivot table) to show notes about that client.
Any help would be greatly appreciated, Thanks!!!There really isn't a god way to do this in CR. The problem is that CR doesn't offer any kind grid object other than the cross tab object. You can try playing around with the cross tab and read the online help files on it but I don't think you'll get it to do what you want.
HTH,
Jason -
Can we create a pivot table of Excel in a JSP page using POI
Hello,
I want to know whether we can create a pivot table of excel sheet in a jsp page using POI package from apache.
thank you.Hi Alex,
Many thanks for replying.
I followed the link, but unable to get correct output.. I have shared the template earlier. I can share the template once again.
It would be grateful if you give me share the working template with table of content. -
Java API for working with Pivot Tables...?
Hi,
I want to create/modify an existing pivot table in an excel sheet. Is there any open source available to work on pivot tables.
I have seen few articles mentioning that POI supports updation of data, though the apache site says that it does not support working with pivot tables. I am able to copy an existing excel template with pivot table to a new excel using poi but am stuck with updating....
Thanx,
Praveen.Hi,
The JExcelAPI does not support working with pivot tables... I am still in search of an open source to work with pivot tables....
btw, we are able to update an existing pivot table using apache poi. But we need to change the data range of the pivot table during run time... Am stuck with this... Has anyone come across any open source to work with pivots???
Regards... -
Need help with Pivoting rows to columns
Hi,
I need help with pivoting rows to columns. I know there are other posts regarding this, but my requirement is more complex and harder. So, please give me a solution for this.
There are two tables say Table 1 and Table 2.
Table1
name address email identifier
x e g 1
f s d 2
h e n 3
k l b 4
Table2
identifier TRno zno bzid
1 T11 z11 b11
1 T12 z12 b12
1 T13 z13 b13
2 T21 z21 b21
2 T22 z22 b22
As you can see the identifier is the column that we use to map the two tables. The output should be like below
output
name address email identifier TRno1 zno1 bzid1 TRno2 zno2 bzid2 TRno3 zno3 bzid3
x e g 1 T11 z11 b11 T12 z12 b12 T13 z13 b13
f s d 2 T21 z21 b21 t22 z22 b22
Also we do not know exactly how many TRno's, zno's, etc each value in the identifier will have. There may be only 1 TRNO, zno and bzid, or there may be four.
All the values must be in separate columns, and not be just comma delimitted. There are also other conditions that i have to add to restrict the data.
So, can you please tell me what is should use to get the data in the required format? We are using Oracle 10g. Please let me know if u need any more informationSomething like this ?
SCOTT@orcl> ed
Wrote file afiedt.buf
1 select a.name,
2 a.address,
3 a.email,
4 b.* from (
5 select distinct identifier
6 ,max(trno1) trno1
7 ,max(zno1) zno1
8 ,max(bzid1) bzid1
9 ,max(trno2) trno2
10 ,max(zno2) zno2
11 ,max(bzid2) bzid2
12 ,max(trno3) trno3
13 ,max(zno3) zno3
14 ,max(bzid3) bzid3
15 ,max(trno4) trno4
16 ,max(zno4) zno4
17 ,max(bzid4) bzid4
18 from (select identifier
19 ,decode(rn,1,trno,null) trno1
20 ,decode(rn,1,zno,null) zno1
21 ,decode(rn,1,bzid,null) bzid1
22 ,decode(rn,2,trno,null) trno2
23 ,decode(rn,2,zno,null) zno2
24 ,decode(rn,2,bzid,null) bzid2
25 ,decode(rn,3,trno,null) trno3
26 ,decode(rn,3,zno,null) zno3
27 ,decode(rn,3,bzid,null) bzid3
28 ,decode(rn,4,trno,null) trno4
29 ,decode(rn,4,zno,null) zno4
30 ,decode(rn,4,bzid,null) bzid4
31 from (select identifier,
32 trno,bzid,zno,
33 dense_rank() over(partition by identifier order by trno,rownum) rn
34 from table2)
35 order by identifier)
36 group by identifier) b,table1 a
37* where a.identifier=b.identifier
SCOTT@orcl> /
NAME ADDRESS EMAIL IDENTIFIER TRNO1 ZNO1 BZID1 TRNO2 ZNO2 BZID2 TRNO3 ZNO3 BZID3 TRNO4 ZNO4 BZID4
x e g 1 T11 z11 b11 T12 z12 b12 T13 z13 b13
f s d 2 T21 z21 b21 T22 z22 b22
SCOTT@orcl> select * from table1;
NAME ADDRESS EMAIL IDENTIFIER
x e g 1
f s d 2
h e n 3
k l b 4
SCOTT@orcl> select * from table2;
IDENTIFIER TRNO ZNO BZID
1 T11 z11 b11
1 T12 z12 b12
1 T13 z13 b13
2 T21 z21 b21
2 T22 z22 b22
SCOTT@orcl>Regards
Girish Sharma -
Please I need some help with a table
Hi All
I need some help with a table.
My table needs to hold prices that the user can update.
Also has a total of the column.
my question is if the user adds in a new price how can i pick up the value they have just entered and then add it to the total which will be the last row in the table?
I have a loop that gets all the values of the column, so I can get the total but it is when the user adds in a new value that I need some help with.
I have tried using but as I need to set the toal with something like total
totalTable.setValueAt(total, totalTable.getRowCount()-1,1); I end up with an infinite loop.
Can any one please advise on some way I can get this to work ?
Thanks for reading
CraigHi there camickr
thanks for the help the other day
this is my full code....
package printing;
import java.awt.*;
import java.awt.event.*;
import java.awt.print.*;
import javax.swing.*;
import javax.swing.table.*;
import java.text.DecimalFormat;
public class tablePanel
extends JDialog implements Printable {
BorderLayout borderLayout1 = new BorderLayout();
private boolean printing = false;
private Dialog1 dialog;
JPanel jPanel = new JPanel();
JTable table;
JScrollPane scrollPane1 = new JScrollPane();
DefaultTableModel model;
private String[] columnNames = {
private Object[][] data;
private String selectTotal;
private double total;
public tablePanel(Dialog1 dp) {
dp = dialog;
try {
jbInit();
catch (Exception exception) {
exception.printStackTrace();
public tablePanel() {
try {
jbInit();
catch (Exception exception) {
exception.printStackTrace();
private void jbInit() throws Exception {
jPanel.setLayout(borderLayout1);
scrollPane1.setBounds(new Rectangle(260, 168, 0, 0));
this.add(jPanel);
jPanel.add(scrollPane1, java.awt.BorderLayout.CENTER);
scrollPane1.getViewport().add(table);
jPanel.setOpaque(true);
newTable();
addToModel();
addRows();
setTotal();
public static void main(String[] args) {
tablePanel tablePanel = new tablePanel();
tablePanel.pack();
tablePanel.setVisible(true);
public void setTotal() {
total = 0;
int i = table.getRowCount();
for (i = 0; i < table.getRowCount(); i++) {
String name = (String) table.getValueAt(i, 1);
if (!"".equals(name)) {
if (i != table.getRowCount() - 1) {
double dt = Double.parseDouble(name);
total = total + dt;
String str = Double.toString(total);
table.setValueAt(str, table.getRowCount() - 1, 1);
super.repaint();
public void newTable() {
model = new DefaultTableModel(data, columnNames) {
table = new JTable() {
public Component prepareRenderer(TableCellRenderer renderer,
int row, int col) {
Component c = super.prepareRenderer(renderer, row, col);
if (printing) {
c.setBackground(getBackground());
else {
if (row % 2 == 1 && !isCellSelected(row, col)) {
c.setBackground(getBackground());
else {
c.setBackground(new Color(227, 239, 250));
if (isCellSelected(row, col)) {
c.setBackground(new Color(190, 220, 250));
return c;
table.addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent e) {
if (e.getClickCount() == 2) {
if (e.getClickCount() == 1) {
if (table.getSelectedColumn() == 1) {
table.setTableHeader(null);
table.setModel(model);
scrollPane1.getViewport().add(table);
table.getColumnModel().getColumn(1).setCellRenderer(new TableRenderDollar());
public void addToModel() {
Object[] data = {
"Price", "5800"};
model.addRow(data);
public void addRows() {
int rows = 20;
for (int i = 0; i < rows; i++) {
Object[] data = {
model.addRow(data);
public void printOut() {
PrinterJob pj = PrinterJob.getPrinterJob();
pj.setPrintable(tablePanel.this);
pj.printDialog();
try {
pj.print();
catch (Exception PrintException) {}
public int print(Graphics g, PageFormat pageFormat, int pageIndex) throws PrinterException {
Graphics2D g2 = (Graphics2D) g;
g2.setColor(Color.black);
int fontHeight = g2.getFontMetrics().getHeight();
int fontDesent = g2.getFontMetrics().getDescent();
//leave room for page number
double pageHeight = pageFormat.getImageableHeight() - fontHeight;
double pageWidth = pageFormat.getImageableWidth();
double tableWidth = (double) table.getColumnModel().getTotalColumnWidth();
double scale = 1;
if (tableWidth >= pageWidth) {
scale = pageWidth / tableWidth;
double headerHeightOnPage = 16.0;
//double headerHeightOnPage = table.getTableHeader().getHeight() * scale;
//System.out.println("this is the hedder heigth " + headerHeightOnPage);
double tableWidthOnPage = tableWidth * scale;
double oneRowHeight = (table.getRowHeight() + table.getRowMargin()) * scale;
int numRowsOnAPage = (int) ( (pageHeight - headerHeightOnPage) / oneRowHeight);
double pageHeightForTable = oneRowHeight *numRowsOnAPage;
int totalNumPages = (int) Math.ceil( ( (double) table.getRowCount()) / numRowsOnAPage);
if (pageIndex >= totalNumPages) {
return NO_SUCH_PAGE;
g2.translate(pageFormat.getImageableX(), pageFormat.getImageableY());
//bottom center
g2.drawString("Page: " + (pageIndex + 1 + " of " + totalNumPages), (int) pageWidth / 2 - 35, (int) (pageHeight + fontHeight - fontDesent));
g2.translate(0f, headerHeightOnPage);
g2.translate(0f, -pageIndex * pageHeightForTable);
//If this piece of the table is smaller
//than the size available,
//clip to the appropriate bounds.
if (pageIndex + 1 == totalNumPages) {
int lastRowPrinted =
numRowsOnAPage * pageIndex;
int numRowsLeft =
table.getRowCount()
- lastRowPrinted;
g2.setClip(0,
(int) (pageHeightForTable * pageIndex),
(int) Math.ceil(tableWidthOnPage),
(int) Math.ceil(oneRowHeight *
numRowsLeft));
//else clip to the entire area available.
else {
g2.setClip(0,
(int) (pageHeightForTable * pageIndex),
(int) Math.ceil(tableWidthOnPage),
(int) Math.ceil(pageHeightForTable));
g2.scale(scale, scale);
printing = true;
try {
table.paint(g2);
finally {
printing = false;
//tableView.paint(g2);
g2.scale(1 / scale, 1 / scale);
g2.translate(0f, pageIndex * pageHeightForTable);
g2.translate(0f, -headerHeightOnPage);
g2.setClip(0, 0,
(int) Math.ceil(tableWidthOnPage),
(int) Math.ceil(headerHeightOnPage));
g2.scale(scale, scale);
//table.getTableHeader().paint(g2);
//paint header at top
return Printable.PAGE_EXISTS;
class TableRenderDollar extends DefaultTableCellRenderer{
public Component getTableCellRendererComponent(
JTable table,
Object value,
boolean isSelected,
boolean isFocused,
int row, int column) {
setHorizontalAlignment(SwingConstants.RIGHT);
Component component = super.getTableCellRendererComponent(
table,
value,
isSelected,
isFocused,
row,
column);
if( value == null || value .equals("")){
( (JLabel) component).setText("");
}else{
double number = 0.0;
number = new Double(value.toString()).doubleValue();
DecimalFormat df = new DecimalFormat(",##0.00");
( (JLabel) component).setText(df.format(number));
return component;
} -
Problem with Pivot Table with Graph: Line Bar Combo
Hello people!
I have a problem with pivot table and line bar combo (all in the same view (pivot table))
I have some measures and one dimension in my report.
--------------measure1---measure2---measure3
Dim A.1
Dim A.2
Dim A.3
If I choose my graph line bar combo automatically choose "line" measure 3 (last measure in "Show Controls"). How can I do if I want my measure1 for line and I don't want modify my pivot table?
Thank you very much!Ok, I'll explain my problem again. In my pivot table I add graph vision and I want in the same view (Pivot table). My graph is "Line Bar Combo" and I don't know how but the last of my measures belongs to right AXIS, if I change order of my measures I can see in my graph the measure that I want in my right axis BUT also it changes the order of my pivot table.
This is my problem. I think that I can do that with different views but I lose my selector view to view graphic and my pivot table at the same time. -
F4 Help with text table in WD abap
Hi,
i am using country related input help with check table T005 in one of table and i want to display the country text along with country id in my table, f4 for country is coming however if i select country from f4 it showing country id in the input field of table.
i want to have country text also in one of my input fields in the table, i have seen f4 help works if we have explicit search help and using parameter assignment we can have id and text defaulted if we use same context for id and text fields, however in this case country table t005 has check table t005 where texts are stored in text table t005t so web dynpro abap is't picking up the texts??
please suggest how can i get the texts as soon as i select country in the f4??Hi Kranthi,
You merely have to have an internal table storing list of countries, which you only need to do once, e.g. on load of application (method WDDOINIT of COMPONENTCONTROLLER). In your view, you have to declare a method for event onEnter of the input field, but this method doesn't have to have any code. Your code will be in method WDDOBEFOREACTION, where you read get country name from country key. Once you've got country name, transfer value to a context attribute to which you've already mapped as a source for attribute value of the UI element.
Check out SAP Webdynpro component FITV_IMG_DEFHTLCATA -> view V_ITEM. -
Hello All,
I need some help with custom tables. I have created a custom table to maintain names and I also did table maintenance generation so that the user can maintain names in this table using SM30 transaction.
The question is, in my program on the selection screen when the user press F4 I need to display the values maintained in this custom table...
Can anyone help me with this.
Thanks
PavanIf I understood you correctly, you have a program in which one or some of the selection screen fields refer to a custom database table field(s).
You want to implement a F4 functionality.
Fill an internal table with the values you want to show.
Call the function module 'F4IF_INT_TABLE_VALUE_REQUEST' in the event AT SELECTION-SCREEN ON VALUE-REQUEST FOR MYPARAM as follows.
call function 'F4IF_INT_TABLE_VALUE_REQUEST'
exporting
retfield = MYITAB-FIELD
dynprofield = MYSELSCREENPARAM
dynpprog = sy-cprog
dynpnr = sy-dynnr
value_org = 'S'
tables
value_tab = my_f4_itab.
Srinivas -
Hi,
I have such problem when I open in Excel 2010 14.0.7128.5000 (32 bit) a xlsx-file containing pivot tables and slicers connected to SSAS 2008 R2 cube:
- Excel found unreadable content in '...'. Do you want to recover the contents of this workbook? If you trust...
And this text after clicking "Yes":
Removed Feature: PivotTable report from /xl/pivotCache/pivotCacheDefinition2.xml part (PivotTable cache)
Removed Feature: PivotTable report from /xl/pivotCache/pivotCacheDefinition3.xml part (PivotTable cache)
Removed Feature: PivotTable report from /xl/pivotTables/pivotTable1.xml part (PivotTable view)
Removed Feature: PivotTable report from /xl/pivotTables/pivotTable3.xml part (PivotTable view)
Removed Records: Workbook properties from /xl/workbook.xml part (Workbook)
What may be the reason?
It has become a regular at some point for files created in Excel 2013. But this file was created in the same excel in which I try to open this file.
Thanks for help in advance.
Best regards,
NikolayHi,
The whole error message like this:
"Excel found unreadable content in '<<var>File name></var>.xls'. Do you want to recover the contents of this workbook?
If you click Yes in the error message, the file cannot be opened as expected."
Please try the following methods and check they are helpful:
1. Install the hotfix for Excel 2010.
http://support.microsoft.com/kb/2544025/en-us
2. Installing the 'Visual Basic' component of MS Office 2010
'Navigate to 'Control Panel >> Programs' -> select Microsoft Office 2010, and then click 'Change >> Add or Remove Programs' -> at the bottom of this list, click the 'plus' sign provided next to Office Shared Features -> click Visual
Basic for Applications -> After that, right-click and choose Run from My Computer -> click Continue'.
3. Run as administrator
4. Go the file in Windows Explorer, right-click on the file, select Properties and at the bottom there's an area called Security, click on Unblock.
Regards,
George Zhao
TechNet Community Support -
Pivot tables in excel with Live Office
Once I save a business objects XI R2 web intelligence report to excel format and schedule to users the excel which the users receive should have pivot tables and users should be able to add any fields of their choice in the report and view it similar to the excel pivot tables.As far as I know I will be able to achive this functionality using Live Office.Is there any other way how I can achieve this and also has anyone worked on this kind of requirement and can confirm this will work without any issues with live office?
It is not possible to schedule the WebI reports in Excel format and use a predefined excel template for this.
What your users CAN do is to add their own pivot tables from the scratch in the excel file that was generated and delivered to them according to the schedule.
What you can do is use LiveOffice (have to install the plug-in on all user workstations though), bind the instances and deliver your users an excel file, which uses liveoffice to bind the scheduled webI report instances (eg. the latest instance). Your users can add the desired pivot table functionality on their own or you can predefine this in the excel file yourself.
Which version of BO do you use?
Regards,
Stratos -
To export pivot table from excel and save as picture using powershell
I am trying to automate my work by attaching an excel file to email and send it across using powershell . But also, I want to paste the screenshot of pivot table to my email body .
One way to do it is to save only the pivot table as picture format like jpeg or png , then attach this picture to the email body .
I am looking for an powershell script which will save my pivot table as picture format . I am using powershell V1.0
please help .I'm not familiar with PowerShell script, we usually use VBA script within excel.
The following article describes how to export Excel Range to a Picture File and attach it as the email body by VBA code, it might not be the answer you are looking for, but hope it will give you some inspirations.
http://www.jpsoftwaretech.com/export-excel-range-to-a-picture-file/
Also you can post your question to PowerShell forum to get better support.
Best Regards,
Wind Zhang -
Showing Zero values in OLAP Pivot Table for Excel 2007
Hello,
I needed a help to a problem. Is it possible to show the values with No sales in an Olap Pivot Table ??
I have a sales Cube, and brwsing it via excel i wanted to filter on a Product Category and see how many products in this category had made no Sales. By default the Pivot table doesn't shows the empty values, so if i check the Showm empty rows option for
Pivot Tables, i see the whole of the products populated with and without sales, and i can't filter further. Is there a way i can only get those which have no sales.
Vinish ViswanathanHappy Holidays,
I can slice on product categories in Excel 2013 with these settings for the Pivot Table:
Activate "Show items with no data for rows and columns"
Apply a value filter that says that the measure should filter on values = 0
Have the product natural hierarchy on rows with levels product category->subcategory->product.
Expand the levels below product category
Use the product category attribute and not the hierarchy as the filter.
I do not have Excel 2007 installed anymore.
HTH
Thomas Ivarsson
Maybe you are looking for
-
Trigger follow up action in Auto UD
Hello Gurus, we have defined follow up action after making UD of inspection lot. the logic is to move the stock from one Sloc to other after UD is made. This follow up action works well when we make UD in QA11 (foreground). however, we observed that.
-
Blank records are showing as '0' in Analytical View
Hi, How to avoid blank records not to be shown as '0' in Analytical View? Can you please help me on this? For your information: from the above image, there's no data for column 3 for Fiscal Period 005 - 012 but it's displaying as '0' rather tha
-
What's worth keeping from old Laptops?
I have an original Titanium PowerBook (1x) and a first release Aluminum PowerBook (2x). 1x doesn't boot, 2x's screen hinge and cable are broken. I have just removed the HDs from both in order to fully erase them to destroy any data on them. Are there
-
Service Entry Sheet Release Strategy
Dear Friends, We are re-configuring Service entry sheet release strategy. My client wants 4 level release strategy like , Level 1 (0-10 lacks ) Level 2 ( 0-50lacks) Level 3 (0-100 lacks ) Level 4 (> 100 lacks ) I have created release group, with rele
-
Why am I seeing commercials since Firefox was supposed to have none?
I'm being bombarded from every sort of commercial, ad, and video commercials. Please make them stop!