Matrix with dates of months as column heading
Hi you all, I'm trying to generate a query with the books name, dates of months as column headings and show the count of books sold on that particular date.
the expected format is
01-Jun-2006 02-Jun-2006 .................... 30-Jun-2006
Book1 2 4 0
Book2 2 0 6
can anyone help me..... please.........
You didn't give us the table structure.
Considering the table having two columns BOOK_NAME and PURCHASE_DATE, find the query below for MAY. Change the Query accordingly if you want for a different month.
SELECT BOOK_NAME,
SUM(DECODE(PURCHASE_DATE,TO_DATE('01-MAY-2006','DD-MON-YYYY'),1,0)) "01-MAY-2006",
SUM(DECODE(PURCHASE_DATE,TO_DATE('02-MAY-2006','DD-MON-YYYY'),1,0)) "02-MAY-2006",
SUM(DECODE(PURCHASE_DATE,TO_DATE('03-MAY-2006','DD-MON-YYYY'),1,0)) "03-MAY-2006",
SUM(DECODE(PURCHASE_DATE,TO_DATE('04-MAY-2006','DD-MON-YYYY'),1,0)) "04-MAY-2006",
SUM(DECODE(PURCHASE_DATE,TO_DATE('05-MAY-2006','DD-MON-YYYY'),1,0)) "05-MAY-2006",
SUM(DECODE(PURCHASE_DATE,TO_DATE('06-MAY-2006','DD-MON-YYYY'),1,0)) "06-MAY-2006",
SUM(DECODE(PURCHASE_DATE,TO_DATE('07-MAY-2006','DD-MON-YYYY'),1,0)) "07-MAY-2006",
SUM(DECODE(PURCHASE_DATE,TO_DATE('08-MAY-2006','DD-MON-YYYY'),1,0)) "08-MAY-2006",
SUM(DECODE(PURCHASE_DATE,TO_DATE('09-MAY-2006','DD-MON-YYYY'),1,0)) "09-MAY-2006",
SUM(DECODE(PURCHASE_DATE,TO_DATE('10-MAY-2006','DD-MON-YYYY'),1,0)) "10-MAY-2006",
SUM(DECODE(PURCHASE_DATE,TO_DATE('11-MAY-2006','DD-MON-YYYY'),1,0)) "11-MAY-2006",
SUM(DECODE(PURCHASE_DATE,TO_DATE('12-MAY-2006','DD-MON-YYYY'),1,0)) "12-MAY-2006",
SUM(DECODE(PURCHASE_DATE,TO_DATE('13-MAY-2006','DD-MON-YYYY'),1,0)) "13-MAY-2006",
SUM(DECODE(PURCHASE_DATE,TO_DATE('14-MAY-2006','DD-MON-YYYY'),1,0)) "14-MAY-2006",
SUM(DECODE(PURCHASE_DATE,TO_DATE('15-MAY-2006','DD-MON-YYYY'),1,0)) "15-MAY-2006",
SUM(DECODE(PURCHASE_DATE,TO_DATE('16-MAY-2006','DD-MON-YYYY'),1,0)) "16-MAY-2006",
SUM(DECODE(PURCHASE_DATE,TO_DATE('17-MAY-2006','DD-MON-YYYY'),1,0)) "17-MAY-2006",
SUM(DECODE(PURCHASE_DATE,TO_DATE('18-MAY-2006','DD-MON-YYYY'),1,0)) "18-MAY-2006",
SUM(DECODE(PURCHASE_DATE,TO_DATE('19-MAY-2006','DD-MON-YYYY'),1,0)) "19-MAY-2006",
SUM(DECODE(PURCHASE_DATE,TO_DATE('20-MAY-2006','DD-MON-YYYY'),1,0)) "20-MAY-2006",
SUM(DECODE(PURCHASE_DATE,TO_DATE('21-MAY-2006','DD-MON-YYYY'),1,0)) "21-MAY-2006",
SUM(DECODE(PURCHASE_DATE,TO_DATE('22-MAY-2006','DD-MON-YYYY'),1,0)) "22-MAY-2006",
SUM(DECODE(PURCHASE_DATE,TO_DATE('23-MAY-2006','DD-MON-YYYY'),1,0)) "23-MAY-2006",
SUM(DECODE(PURCHASE_DATE,TO_DATE('24-MAY-2006','DD-MON-YYYY'),1,0)) "24-MAY-2006",
SUM(DECODE(PURCHASE_DATE,TO_DATE('25-MAY-2006','DD-MON-YYYY'),1,0)) "25-MAY-2006",
SUM(DECODE(PURCHASE_DATE,TO_DATE('26-MAY-2006','DD-MON-YYYY'),1,0)) "26-MAY-2006",
SUM(DECODE(PURCHASE_DATE,TO_DATE('27-MAY-2006','DD-MON-YYYY'),1,0)) "27-MAY-2006",
SUM(DECODE(PURCHASE_DATE,TO_DATE('28-MAY-2006','DD-MON-YYYY'),1,0)) "28-MAY-2006",
SUM(DECODE(PURCHASE_DATE,TO_DATE('29-MAY-2006','DD-MON-YYYY'),1,0)) "29-MAY-2006",
SUM(DECODE(PURCHASE_DATE,TO_DATE('30-MAY-2006','DD-MON-YYYY'),1,0)) "30-MAY-2006",
SUM(DECODE(PURCHASE_DATE,TO_DATE('31-MAY-2006','DD-MON-YYYY'),1,0)) "31-MAY-2006"
FROM BOOKS
GROUP BY BOOK_NAME
Regards,
Mohana
Similar Messages
-
Hi,
I like to fill system Matrix with data; please find the code below.
Thank you very much for your good work and support.
Thank you,
Rune
CODE
#region SalesOrderItemLine_GetDataFromDataSource
public void SalesOrderItemLine_GetDataFromDataSource( SAPbouiCOM.Form oForm, bool Matrix77_AddRefresh )
try
if ( Matrix77_AddRefresh )
oForm.DataSources.DataTables.Add("SYS_77");
oForm.DataSources.DataTables.Item("SYS_77").ExecuteQuery("SELECT [Code],[Name],[U_Weight],[U_PoNo],[U_CoopName],[U_Consignee],[U_PalGroup],[U_Container],[U_ItemCode],[U_CheckBoxSelect] FROM [dbo].[@MyTable] WHERE [U_MatrixAorB] = 'A' AND [U_WRKsalesOrderYN] = 'N'");
( ( SAPbouiCOM.Matrix ) ( oForm.Items.Item("77").Specific ) ).Columns.Item("1").DataBind.Bind("SYS_77", "U_ItemCode");
( ( SAPbouiCOM.Matrix ) ( oForm.Items.Item("77").Specific ) ).Clear();
( ( SAPbouiCOM.Matrix ) ( oForm.Items.Item("77").Specific ) ).LoadFromDataSource();
( ( SAPbouiCOM.Matrix ) ( oForm.Items.Item("77").Specific ) ).AutoResizeColumns();
catch ( Exception Error )
oApplication.MessageBox("Add-On Error-3232: = " + Error.Message, 1, "Ok", "", ""); // My Error Code
#endregionHi David!
This is a Product Development Collaboration suggestion!
I like to load data into system matixes...that could be really nice!
(No my problem is still out there...
Thank you,
Rune -
HR -- adding year with date and month
Hi all,
Can any one let me know what is the logic for adding Year with date and month in HR.
ex: 01.10.2008 from this date it should be 2 years.
thnks
joshi.Hi
u can add days to the date directly ....
if u have the date V_DATE of type sy-datum u can add directly number of days to get disired date ..
v_date1 = v_date + 365 .
hope it helps .......... -
Get matrix row data and put it into header field with formatted search ???
Hi All,
I ask your help concerning the following:
On an invoice matrix I want to check all Itemgroup Codes of all items in the rows, if there are some rows' items with ItemGroupcode 101 and some others with anything else, then header field should be Y, otherwise N.
My main problem is: how do I put a matrix row data to a header data with checking all rows in the matrix?
A minor problem is that I can't get the formatted search to work on all rows when the formatted search is assigned to the user field in header.
If I put the formatted search to a row field then the row field is filled with the proper value, but the same query assigned to the user field in header works only on the first row.
What am I doing wrong?
SELECT USEDPROD= CASE T0.ItmsGrpCod WHEN 101 THEN Y ELSE N END FROM .[OITM] T0 WHERE T0.ItemCode = $[$38.1.0]
(SBO 7.6)
Any suggestions are welcome.
Thanks.
BálintDear Adele,
Thanks for the answer. The major one cannot be solved. OK, I'll try to get a workaround.
However I still do not understand why my query does not work in all selected rows, just in the first row, i.e. if I assign the query to a header field and I'm positioned in the first row it's OK, but when I add a new item to the second row or any of the next rows, the header field is not updated at all.
Why is that so? Do you have any idea?
Bálint -
ALV column header with multiple rows and ALV column header span
How could I have in an ALV a column header on several lines and/or a column header that spans on multiple columns?
i.e. I would like to have in an ALV two columns, each with it's own distinct header and additionally another column header for both of the columns, that spans across both columns. How could I program this?Hi,
follow below mentioned code
SET THE LABEL OF THE COLUMN
DATA: hr_weeknum TYPE REF TO cl_salv_wd_column_header.
CALL METHOD lr_weeknum->get_header
RECEIVING
value = hr_weeknum.
CALL METHOD lr_weeknum->set_resizable
EXPORTING
value = abap_false.
hr_weeknum->set_prop_ddic_binding_field(
property = if_salv_wd_c_ddic_binding=>bind_prop_text
value = if_salv_wd_c_ddic_binding=>ddic_bind_none ).
set the text of the column
CALL METHOD hr_weeknum->set_text
EXPORTING
value = 'C Form'.
Regards,
Srini. -
Need dynamically generated ( in PL/SQL) Month in column header.
Hello,
I need to dynamically display the month in a column header and have tried using PL/SQL . I can paste following in the "Column Atributes" PL/SQL heading type to show names in the column headings:
return 'RESOURCE_NAME:TEAM:PROJECT'
but I need to show a column heading that changes each month. I can get the month to show in a region this way: htp.p(TO_CHAR(SYSDATE,'Month'))
but when I try to combine the two like this:
return 'RESOURCE_NAME:TEAM:PROJECT:htp.p(TO_CHAR(SYSDATE,'Month'))'
and put it in the column header, I get a mess.
Please tell me what I am doing wrong. Thanks.
LindaHello Dimitri,
Your solution to dynamically generating the Month in a column header worked out great!
Well, now I am trying to do the same in a lable of a form page. I try going to the Edit Page Item page (Home>Application Builder>Application 135>Page 8>Edit Page Item) and paste the same code on the "Source" and select "PL/SQL Function Body" but do not have any luck.
Do you have any suggestions?
Thanks
Linda -
Dynamic tables with data driven visibility of columns (XML).
Hi
I am trying to make a template in LiveCycle Designer (XDP) with a dynamic table, and with dynamic visibility of columns.
I want the column visibility to be driven by the xml input.
(There is no user input.)
I want the columns to visible in the table only if one or more of the rows has a data cell with value in a spesific column. If not the entire column should dissappear from the generated pdf.
If that is not possible, my alternative is so set a value in th XML file to hide a tables column. But how?
I have no problems of making dynamic tables, that is solved.
I only want to hide unused columns in a table, defined in the xml source file.
Can anyone help?
BorgeHi,
The link is not working..
Please provide a valid link. -
Matrix with different dimensions for each column
Hi,
I would like to have a matrix with different dimensions (rows) for each
column, for example, I want the first column has 3 rows, the second one
5 rows, the third one 10 rows, and so on.....
With a simple array it is not possible, and then I make an array (for
my columns) of clusters and each cluster has another array (rows for
that column). Is it the best way to do it? Is it correct?
Thanks,
ToNi.Yes, everything we told you in this old thread is still true!
LabVIEW Champion . Do more with less code and in less time . -
Interactive Report (IR) column heading: filtered items number & flashlight
Hello everyone
several hours of searching through the forum did not provide me with leads or answers to 2 questions. Both are related to the IR column heading menu and options. Let's start with a copy of the relevant portion of the interactive report help screen:
Column Heading Menu
Clicking on any column heading exposes a column heading menu.
[snip]
Text Area is used to enter case insensitive search criteria (no need for wild cards). Entering a value will reduce the list of values at the bottom of the menu. You can then select a value from the bottom and the selected value will be created as a filter using '=' (e.g. column = 'ABC'). Alternatively, you can click the flashlight icon and the entered value will be created as a filter with the 'LIKE' modifier (e.g. column LIKE '%ABC%').
List of Unique Values contains the first 500 unique values that meet your filters. If the column is a date, a list of date ranges is displayed instead. If you select a value, a filter will be created using '=' (e.g. column = 'ABC').
Q1: Why do I not see a flashlight icon? I looked everywhere in the report definition to "enable" it, to no avail.
Q2: Although we've found IRs to be incredibly useful and embraced by end users, we are having issues when dealing with large datasets. Let's look at searching for people's first/last name in our CONTACTS table. The table is ~28,000 names long. If one attempts to use Column Heading menu to "filter" for any name outside the first 500 unique values, the search does not work. Yes, I know that a workaround is to use Actions Menu icon filter... but, it sure is misleading to have a search which does not go beyond letter B in the list of last names. Furthermore, I do not see a way to DISABLE Column Heading Text Area, and avoid user confusion.
I suspect that "List of Unique Values contains the first 500 unique values" was set for the performance purposes. Is there a way to set that number anywhere? Have it customized for each column? (columns county and state could be <100, for example)
Thanks an advance to any advice.
Vojin@Prabodh: what you say is only changing the default image for the column selector at the search bar level. What i think is being looked for is an icon on the popup when a column header is clicked in an IR. Don't bother: there is none.
@Vojin, Tonibony:
I also ran into this problem with IRs and the useless column header box. If you want to hide the unique values list, it is a bother. First of all, you can't disable the finding of values, this is embedded in the widget ajax code. Then if you want to just hide the list, there is no real event you can hook up to. The poping up of the box is an ajax callback, and is part of the IR javascript, but this callback does not trigger any event (no apexafterrefresh for example, which is understandable). I've worked around this by overriding/extending the method which is called when ajax is done loading within the IR code. Here is a piece of code which does this (call it on page load):
// _Finished_Loading is called when the IR is done with a GET action
// because the posts are synchronous in this report, and no events
// or hooks are available, the best way to preserve functionality
// yet extending it is to override the original function, yet
// keep the base code
// apexafterrefresh cant be used since it is not triggered after
// the widget ajax
var or_Finished_Loading = gReport._Finished_Loading;
gReport._Finished_Loading = function(){
//overriden, but still have to call orinigal!
or_Finished_Loading();
//SORT_WIDGET is the widget containing all the header elements
if(gReport.current_control=='SORT_WIDGET'){
// hide the original dropdown box
$("#apexir_rollover_content").hide();
};If you're interested, i've recently developed a plugin for use in my interactive reports which works around some of these limitations. For me, the headers are much more userfriendly than the actions > filter menu. So what i've done is: hide the orignal dropdown, and turn the searchfield into an autocompletion field, which will progressively search through the distinct column values in the IR with ajax. I've even made an option to have the searching behave like a "contains" or a "like". I'm working on a post about it, with background, documentation and source code. I'll add a post here when i finish it up, you can see if that helps you.
I also would like to add a button later on which will simply add the entered value as a "like %value%" filter. I know how to do this and what to do, i'm just a bit short on time at the moment. I actually think that adding the button in the layout may be the hardest part... :') -
How to change "Details" column header text in AdvanceTable in AdvancedTable
Hi All,
i am using adavanced table in advanced table in OAF page to show the master and details ,
my requirement is to change the header text of "Details" to some other meaning ful text .
"Details' column will be visible at runtime ,no we cant change using process request ,
Please help me on this ,its urgent
Thanks & Regards
Maheswara RajuYou can get the handle to the Detail column by using the following:
UINode d = outerTable.getDetail();
However, as per OAF developer guide, it is not possible to change the label for the detail column. The devloper guide has the following:
"In accordance with BLAF guidelines, the Detail column header text for the detail disclosure column and the Show/Hide link texts within the cells of the detail disclosure column can not be modified."
Cheers,
Saurabh -
How to show timestamp along with date in LOV dropdown
Hi,
We have a requirement to show timestamp along with date as a display column in a LOV drop down. Type of the date column in VVO is set to timestamp. But still it is showing only date in the UI.
But it is showing timestamp when we run it through AM. Is there any thing in to do in addition to display it in UI? Or it is not feasible? Please suggest me on this issue.
Thanks in advance.
Thanks,
SanthoshThe date format displayed in UI depends on applcore preference set for current user, try changing date format set for current user to include time along with date.
-
Synchronize with Data Base' bug
JDeveloper Version : JDeveloper 11.1.1.1.0 , ADF BC
Use Case :
- we have DB Table with filed named "Flage" and type "Number"
- Create EO
- Change "Flage" ' data type from "Number" to "varchar2" in DB
- Use "Synchronize with Data Base" option for EO .
The result for "Flage" attribute is :
- Column Type : changed to "varchar2 " --- same as DB
- Attribute Type : still have old type "Number"
AND XML :
Name="Flage"
ColumnName="Flage"
SQLType="VARCHAR"
Type="oracle.jbo.domain.Number"
ColumnType="VARCHAR2"
TableName="Test"
IsNotNull="true"
Precision="200"
Error will raise if you try to insert Character into "Flage" field
and to fix problem we should change Attribute Type for EO to "Number" manually
so , it is function of "Synchronize with Data Base " to change
Column Type and not change Attribute Type ??? or there is some thing missing ??
Thanx
Wael No'man
Edited by: Wael No'man on Aug 16, 2009 11:05 PMHi,
Currently Jdev supports synchronizing the database column type & not the attribute type.
An Enhancement Request already exists for this.
Regards,
Shantala -
Matrix report data with summary column in excel format
Hi ,
I want to display output of matrix report with summary column in excel format.
I have tried using spreadsheet but column header and actual data is displaying in proper order.
Please tell me the way how to do this ASAP.
Thanks in advance.Hi ,
I want to display output of matrix report with summary column in excel format.
I have tried using spreadsheet but column header and actual data is displaying in proper order.
Please tell me the way how to do this ASAP.
Thanks in advance. -
Download internal table data into excel sheet with column heading and data
Hi,
I am having one internal table with column headings and other table with data.
i want to download the data with these tables into an excel sheet.
It should ask the user for file name to save it on their own name. They should give the file name in runtime and it should be downloaded into an excel sheet.
Can anyone tell what is the right function module for downloading these two internal table data with column heading and data.
what we have to do for storing the file name in runtime.
Can anyone help me on this.
Thanks,
Rose.Hi Camila,
Try this
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
FILENAME = PATH2
FILETYPE = 'XLS'
TABLES
DATA_TAB = IT_DATA
FIELDNAMES = IT_HEADINGS
EXCEPTIONS
FILE_WRITE_ERROR = 1
NO_BATCH = 2
GUI_REFUSE_FILETRANSFER = 3
INVALID_TYPE = 4
NO_AUTHORITY = 5
UNKNOWN_ERROR = 6
HEADER_NOT_ALLOWED = 7
SEPARATOR_NOT_ALLOWED = 8
FILESIZE_NOT_ALLOWED = 9
HEADER_TOO_LONG = 10
DP_ERROR_CREATE = 11
DP_ERROR_SEND = 12
DP_ERROR_WRITE = 13
UNKNOWN_DP_ERROR = 14
ACCESS_DENIED = 15
DP_OUT_OF_MEMORY = 16
DISK_FULL = 17
DP_TIMEOUT = 18
FILE_NOT_FOUND = 19
DATAPROVIDER_EXCEPTION = 20
CONTROL_FLUSH_ERROR = 21
OTHERS = 22 -
Data of matrix(with userdatasource columns) dissapear in form_add mode
Hi all,
Why when i put the mode of my userform in ADD_mode the data of my matrix (with userdatasource data in columns,not linked to one table) disapear?.
How i can do to not lost data? Exist any way?
Thank you all again.
Regards.Aitor,
I guess you are using UDO, and set it the ObjectType to form.
It is a default behavior that B1 will clear the form for new entry, when it switchs to add mode.
Would you specify the scenario more? Why would you like to keep the data in the form from Find / OK to Add mode?
Kind Regards
-Yatsea
Maybe you are looking for
-
How to store something in text file?
Hello I have question and i do not know how to do this. can any one explain for me how i can save something in a text file. i create calculator,and there is one question i need to do it:((Store the record of the session in a text file. )) what i need
-
How do I set up a rescue e-mail?
I can't do anything with iTunes because I don't know my security questions and I don't have a rescue e-mail. How do I set up a rescue e-mail?
-
can I download upgrade to LR5.6 for seeing Canon 7D Mark 2?
-
Hi,i have formatted XP S.P.2 and now i'm using Vista Ultimate 64.I have got an X-Fi Elite Pro and i have installed all the applications using the CD-Rom.I updated the driver, Alchemy and Mediasource to the latest version.The system is totally clean a
-
I have an 2006 imac that is maxed out on hard drive space.
I moved my iphoto libraries to an external hard drive but my home folder is still showing 112 GB in the pictures folder. What have I done wrong? Im afraid to delete anything out of my home folder for fear of corrupting something. If I eject the ext