BSIS - GROUP By Week Across Columns

I am new to ABAP Query...Using SQ01 to create a query of BSIS table.
I ultimately want to pull all cost center (KOSTL), account (HKONT) combinations in Local Currency (DMBTR) and GROUP the data by week based on posting date (BUDAT).  I want the weeks as columns in the query.
Report...                  Week 1          Week 2         Week 3         Week 4
KOSTL, HKONT          XX                    XX                 XX                XX
Can anyone please help me with how to make this happen.  Do I need to use ABAP code?
Thanks

that's not possible without abap coding - better write an abap-report:
- that's your internal table:
begin of itab..
      hkont,
      kostl,
      week,
      wrbtr,...
-use fm DATE_GET_WEEK to convert BUDAT into week.-no.
hope that helps
A.

Similar Messages

  • Group by week between date range

    Hi,
    i'm having a table for documents. The documents are received from diffeent dates. I've to calculate number of documents received on weekly basis.
    I need an sql to count the number of documents between two given dates grouping by weekly.
    My week starts on Sunday and ends with Saturday.
    I've tried group by with to_char(documentdate,'IW') , but this will take Monday to Sunday as a week & the incomlete weeks i'm not able to calculate. ie : in the below output the date range 1/28/2007 - 1/31/2007 is not a complete week . ( ie saturday to wednesday)
    I need out put should be like this for Date Range: 12/31/2006 to 1/31/2007
    week               count of documents
    12/31/2006 - 1/6/2007 10
    1/7/2007 - 1/13/2007     40
    1/14/2007 - 1/20/2007     30
    1/21/2007 - 1/27/2007     20
    1/28/2007 - 1/31/2007 10
    Please help me to get this.....
    (columns in documents table is documentid and documentdate)

    your're very close with IW. you just need to shift the data to get it to fall within the correct range. btw, you don't need julian dates. it's overkill
    trunc(date+1,'IW') will push the date into the correct week range (IW will put sunday one week earlier than you want, so push it ahead a day before truncating).
    then subtract 1 day from the result to get it to display with sunday's date instead of monday
    trunc(mydate+1, 'IW')-1
    and the week end date is simply trunc(mydate+1, 'IW')_5
    select mydate, to_char(mydate,'Dy') dy,
    trunc(mydate+1,'IW')-1 wk_Start,
    trunc(mydate+1,'IW')+5 wk_end
    from (select sysdate-rownum mydate from dual connect by level < 20)
    order by 1

  • Grouping Data Weekly

    Hi,
    I have a query in sql
    Table employees
    columns : empid,hiredate,job_id,salary
    I want to count(empid) and group data weekly with job_id , order by month.
    Sample of Data like :
    mon week job_id count(empid)
    jan week1 sa_rep 15
    jan week2 sa_rep 20
    jan week3 sa_rep 35
    jan week4 sa_rep 40
    feb week1 sa_rep 10
    feb week2 sa_rep 05
    feb week3 sa_rep 12
    feb week4 sa_rep 15
    Help please
    Thanks and Regards,
    Ramesh J C

    you can
    group by to_char(hiredate, 'IW'),  --week of year
                  to_char(hiredate, 'Month')and
    order by to_char(hiredate, 'Month')

  • Keep together gropus across columns

    Hello! I'm creating a lot of reports with Crystal Reports for Visual Studio 2010, and I'm unable to keep togheter groups across columns. This funcionality only works across pages.
    I've benn searching a lot in this forum and others and it appears that it's impossible to do this. And it also appears that the problem has been there for many years and still no solutions for this issue.
    This is a huge weakness for Crystal Reports, because displaying details in colums is very useful for many reasons, so I want to know if anyone has found any kind of solution for this and if there will be a solution soon.
    Thanks in advance.

    hi Gustaav,
    questions:
    1) are you referring to a Multi-Column report where you want to force the new group to start in a new column?
    2) if a group is longer than one column do you want it to start on a new column as well?
    3) if a group is longer than one column, do you want to have the group header repeated on the 2nd, 3rd... columns?
    jw

  • Grouping by a Metadata Column in a SharePoint Document Library

    Hi All,
    I have a document library with a managed metadata column. Now I need to create a view in which i need to group by the metadata column but I'm not able to see the managed metadata column in the Group By Columns list. Is it possible to accomplish this? Can
    anyone pls help me out. Thank you.

    It's kind of a lot of code... but here goes!
    This all goes into a separate JS file:
    (Tip, to copy this code chunk, it's easiest to start your selection outside the code block)
    var js_MultiFilter = (function () {
    function js_MultiFilter(listName, site) {
    this.document = document; f (typeof listName == "undefined") { listName = 'Documents'; }if (typeof site == "undefined") { this.useCurrentSite = true; }else { this.useCurrentSite = false; }this.listName = listName;this.listRootfolder = "";this.site = site;this.notificationEnabled = true;this.filterFields = []; this.filterNames = []; this.selectModes = []; this.filterValueLists = []; this.displayFields = []; this.displayNames = []; this.displayModes = []; this.items = []; this.potentialFilters = []; this.queryFields = []; this.selectedFilters = []; this.sortField = "Title"; this.sortDesc = false; this.selectMode = "checkbox"; this.filterHeadingClass = "js_MFFilterHeading"; this.filterTableClass = "js_MFFilterTable"; this.filterColumnClass = "js_MFFilterColumn"; this.innerFilterColumnClass = "js_MFInnerFilterColumn"; this.filterCheckboxClass = "js_MFFilterCell"; this.displayOuterClass = "js_MFResultOuter"; this.displayTableClass = "js_MFResultTable"; this.displayRowClass = "js_MFResultRow";
    this.displayHeaderClass = "js_MFResultHeader"; this.displayCellClass = "js_MFResultCell"; this.filterLabelClass = "js_MFFilterLabel"; this.filterLabelHoverClass = "js_MFFilterHoverLabel"; this.filterLabelSelectClass = "js_MFFilterSelectLabel"; this.filterLabelUnusedClass = "js_MFFilterUnusedLabel"; this.resultCountClass = "js_MFResultCount"; this.maxResultHeight = "270px"; this.rowLimit = 100; this.divId; this.evenColumnWidths = true; this.evenFilterColumnWidths = true; this.resultsId = "js_MultiFilterResults1"; this.showMetadataGuids = false; this.maxFilterHeight = 13;
    /*Methods*/ this.containsString = containsString; this.getIndexOf = getIndexOf; this.addDisplayField = addDisplayField; this.addStaticDisplayField = addStaticDisplayField; this.addFilterField = addFilterField; this.bindToDiv = bindToDiv; this.onQuerySucceeded = onQuerySucceeded; this.onQueryFailed = onQueryFailed; this.getValueAsString = getValueAsString; this.showLoading = showLoading; this.removeLoading = removeLoading; this.toggleAndApplyFilter = toggleAndApplyFilter; this.applyFilter = applyFilter; this.insertDefaultCss = insertDefaultCss; this.get_defaultCss = get_defaultCss; this.isPageInEditMode = isPageInEditMode; this.HoverFilterLabel = HoverFilterLabel; this.DeHoverFilterLabel = DeHoverFilterLabel;
    /*Interface Functions*/
    function isPageInEditMode() { return (document.forms[0].elements["MSOLayout_InDesignMode"].value == "1") }
    function addFilterField(fieldName, displayName, selectMode) { if (typeof (displayName) == "undefined") { displayName = fieldName; } if (typeof (selectMode) == "undefined") { selectMode = this.selectMode; } this.filterFields.push(fieldName); this.filterNames.push(displayName); this.selectModes.push(selectMode.toString().toLowerCase()); var filterValueList = []; this.filterValueLists.push(filterValueList); var potFilterValueList = []; this.potentialFilters.push(potFilterValueList); if (!this.containsString(this.queryFields, fieldName)) { this.queryFields.push(fieldName); } }
    function addDisplayField(fieldName, displayName, displayMode) { if (typeof (displayName) == "undefined") { displayName = fieldName; } if (typeof (displayMode) == "undefined") { displayMode = "default"; } this.displayFields.push(fieldName); this.displayNames.push(displayName); this.displayModes.push(displayMode); if (!this.containsString(this.queryFields, fieldName)) { this.queryFields.push(fieldName); } }
    function addStaticDisplayField(displayText, displayName, displayMode) { if (typeof (displayName) == "undefined") { displayName = displayText; } if (typeof (displayMode) == "undefined") { displayMode = "default"; } this.displayFields.push("@" + displayText); this.displayNames.push(displayName); this.displayModes.push(displayMode); }
    function insertDefaultCss(RevertToDefaultStyles) { var js_style = this.document.createElement("style"); js_style.type = "text/css"; document.getElementsByTagName("head")[0].appendChild(js_style); var newCss = this.get_defaultCss(RevertToDefaultStyles); if (typeof js_style.styleSheet != "undefined") { js_style.styleSheet.cssText = newCss; } else { js_style.appendChild(this.document.createTextNode(newCss)); } }
    function bindToDiv(divId) { /* Causes the control to appear in the specified div.*/ if (typeof (divId) != "undefined") { this.divId = divId; } if (this.notificationEnabled) { showLoading(this); } var clientContext; if (this.useCurrentSite) { clientContext = new SP.ClientContext.get_current(); } else { clientContext = new SP.ClientContext(this.site); } var web = clientContext.get_web(); var lists = web.get_lists(); var list = lists.getByTitle(this.listName); var camlQuery = new SP.CamlQuery(); var descending = ""; if (this.sortDesc) { descending = " Ascending='False'"; } var camlString = '<View><Query><OrderBy><FieldRef Name=\'' + this.sortField + '\'' + descending + '/></OrderBy></Query><RowLimit>' + this.rowLimit + '</RowLimit></View>'; camlQuery.set_viewXml(camlString); this.collListItem = list.getItems(camlQuery); var strFields = "ID,"; if (containsString(this.displayModes, "fileref", true)) { strFields += "FileRef," }
    for (var i = 0; i < this.queryFields.length; i++) { strFields += this.queryFields[i] + ","; } strFields = strFields.substring(0, strFields.length - 1); this.listRootfolder = list.get_rootFolder(); clientContext.load(this.listRootfolder); clientContext.load(this.collListItem, "Include(" + strFields + ")"); clientContext.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceeded), Function.createDelegate(this, this.onQueryFailed)); }
    function showLoading(parent) { parent.notifyId = SP.UI.Notify.addNotification("Loading...", true); }
    function removeLoading(parent) { SP.UI.Notify.removeNotification(parent.notifyId); }
    function getValueAsString(fieldValue, activeHyperlinks, showLinkUrl, displayMode, additionalFieldValue) { var localNull = null; if (typeof (displayMode) == "undefined") { displayMode = "default"; } /*wraps hyperlink text in <a> tag*/ if (typeof (activeHyperlinks) == "undefined") { activeHyperlinks = false; } /*causes hyperlinks to display URL by default instead of description*/ if (typeof (showLinkUrl) == "undefined") { showLinkUrl = true; } var returnValue = []; var isArray = false if (typeof (fieldValue) == "object" && fieldValue != localNull) { if (fieldValue[0] != localNull) { if (fieldValue.length) { for (var i = 0; i < fieldValue.length; i++) { returnValue.push(this.getValueAsString(fieldValue[i])); isArray = true; } } } } if (!isArray) { if (fieldIsText(fieldValue)) { if (displayMode.toString().toLowerCase() == "link") { returnValue = '<a href="' + fieldValue + '">' + fieldValue + '</a>'; }
    else if (displayMode.toString().toLowerCase() == "display") { returnValue = '<a href="' + this.listRootfolder.get_serverRelativeUrl() + '/Forms/DispForm.aspx?ID=' + additionalFieldValue + '">' + fieldValue + '</a>'; } else if (displayMode.toString().toLowerCase() == "edit") { returnValue = '<a href="' + this.listRootfolder.get_serverRelativeUrl() + '/Forms/EditForm.aspx?ID=' + additionalFieldValue + '">' + fieldValue + '</a>'; } else if (displayMode.toString().toLowerCase() == "fileref") { returnValue = '<a href="' + additionalFieldValue + '">' + fieldValue + '</a>'; } else { returnValue = fieldValue; } } else { if (fieldValue == localNull) { returnValue = ""; } else { if (fieldIsDate(fieldValue)) { returnValue = fieldValue._toFormattedString(); } else { if (fieldIsHyperlink(fieldValue)) { var desc = fieldValue.get_description(); var url = fieldValue.get_url(); if (showLinkUrl) { if (url != localNull) { returnValue = url; } else { if (desc != localNull) { returnValue = desc; } } }
    else { if (desc != localNull) { returnValue = desc; } else { if (url != localNull) { returnValue = url; } } } if (activeHyperlinks && url != localNull) { returnValue = '<a href="' + url + '">' + returnValue + '</a>'; } } else { if (fieldIsLookup(fieldValue)) { if (displayMode.toString().toLowerCase() == "link") { returnValue = '<a href="' + fieldValue.get_lookupValue() + '">' + fieldValue.get_lookupValue() + '</a>'; } else { if(fieldValue.get_lookupValue() == ""){ /* When doing a lookup count, the lookup ID is used */ returnValue = fieldValue.get_lookupId(); }else{ returnValue = fieldValue.get_lookupValue(); } } } else { returnValue = ""; } } } } } } return returnValue; }
    function onQuerySucceeded(sender, args) { var listItemEnumerator = this.collListItem.getEnumerator(); while (listItemEnumerator.moveNext()) { var oListItem = listItemEnumerator.get_current(); var localNull = null; var item = new Object(); item.filterValues = []; item.displayValues = []; for (var i = 0; i < this.filterFields.length; i++) { var filterValue = []; /*Collect all filter values*/ var rawValue = this.getValueAsString(oListItem.get_item(this.filterFields[i])); if (typeof (rawValue) == "string") { filterValue.push(rawValue); } else { filterValue = rawValue; } for (var k = 0; k < filterValue.length; k++) { /*if this value hasn't been encountered before, add it to our filter value list for this filter field*/ var thisvalue = filterValue[k]; if (this.showMetadataGuids == false) { if (thisvalue.indexOf('|') != -1) { thisvalue = thisvalue.split('|')[0]; } } if (!containsString(this.filterValueLists[i], thisvalue)) { this.filterValueLists[i].push(thisvalue); } } item.filterValues.push(filterValue); }
    for (var j = 0; j < this.displayFields.length; j++) { var initialValue = this.displayFields[j]; if (initialValue.startsWith("@")) { initialValue = initialValue.substring(initialValue.indexOf("@") + 1); } else { initialValue = oListItem.get_item(this.displayFields[j]) } /*Collect all display values*/ if (this.displayModes[j] == "fileref") { var displayValue = this.getValueAsString(initialValue, true, false, this.displayModes[j], oListItem.get_item("FileRef")); } else { var displayValue = this.getValueAsString(initialValue, true, false, this.displayModes[j], oListItem.get_item("ID")); } item.displayValues.push(displayValue); } this.items.push(item); } var filterSelectBoxes = []; for (var i = 0; i < this.filterFields.length; i++) { var selectbox = this.document.createElement("div"); selectbox.className = this.filterColumnClass; selectbox.setAttribute("index", i); var heading = this.document.createElement("div"); heading.className = this.filterHeadingClass;
    heading.innerHTML = this.filterNames[i]; selectbox.appendChild(heading); var columnContainer = document.createElement("div"); selectbox.appendChild(columnContainer); var innerColumns = []; for (var j = 0; j < this.filterValueLists[i].length; j += this.maxFilterHeight) { var innerColumn = document.createElement("div"); innerColumn.className = this.innerFilterColumnClass; innerColumns.push(innerColumn); columnContainer.appendChild(innerColumn); } this.filterValueLists[i].sort(); for (var j = 0; j < this.filterValueLists[i].length; j++) { var input = document.createElement("input"); input.type = this.selectModes[i]; input.className = this.filterCheckboxClass; var checkboxText = this.filterValueLists[i][j]; input.setAttribute("name", this.filterFields[i]); input.id = "js_mf_" + i + "_" + j; var labelid = "label_" + i + "_" + j; input.setAttribute("label", labelid); input.value = checkboxText; var checkboxlabel = document.createTextNode(checkboxText); var checkboxlabelspan = document.createElement("span");
    checkboxlabelspan.className = this.filterLabelClass; checkboxlabelspan.id = labelid; checkboxlabelspan.setAttribute("checkbox", input.id); checkboxlabelspan.appendChild(checkboxlabel); var parent = this;
    /*ADD EVENT HANDLER*/ if (input.addEventListener) { /*chrome, firefox, and new IE*/ input.addEventListener("change", function (element) { parent.applyFilter(element, parent) }); input.addEventListener("click", function (element) { parent.applyFilter(element, parent) }); checkboxlabelspan.addEventListener("click", function (element) { parent.toggleAndApplyFilter(element, parent) }); checkboxlabelspan.addEventListener("mouseenter", function (element) { parent.HoverFilterLabel(element, parent) }); checkboxlabelspan.addEventListener("mouseout", function (element) { parent.DeHoverFilterLabel(element, parent) }); } else { /*legacy internet explorer*/ input.attachEvent("onchange", function (element) { parent.applyFilter(element, parent) }); input.attachEvent("onclick", function (element) { parent.applyFilter(element, parent) }); checkboxlabelspan.attachEvent("onclick", function (element) { parent.toggleAndApplyFilter(element, parent) });
    checkboxlabelspan.attachEvent("onmouseenter", function (element) { parent.HoverFilterLabel(element, parent) }); checkboxlabelspan.attachEvent("onmouseout", function (element) { parent.DeHoverFilterLabel(element, parent) }); } var currentColumnIndex = 0; for (var k = 0; k < innerColumns.length; k++) { if (j >= k * this.maxFilterHeight) currentColumnIndex = k; } var currentColumn = innerColumns[currentColumnIndex]; currentColumn.appendChild(input); currentColumn.appendChild(checkboxlabelspan); currentColumn.appendChild(document.createElement("br")); } filterSelectBoxes.push(selectbox); } var htmlToWrite = document.createElement("div"); htmlToWrite.className = this.filterTableClass; for (var i = 0; i < filterSelectBoxes.length; i++) { htmlToWrite.appendChild(filterSelectBoxes[i]); }
    /*clear the loading image and add our filters*/ document.getElementById(this.divId).innerHTML = ""; document.getElementById(this.divId).appendChild(htmlToWrite);
    /*Create the div to display the results*/ var detailsDiv = document.createElement("div"); detailsDiv.className = this.displayOuterClass; var detailIdstring = "Details"; iterator = 0; var detailsId = detailIdstring + iterator; while (this.document.getElementById(detailsId) != localNull) { iterator = iterator + 1; detailsId = detailIdstring + iterator; } detailsDiv.id = detailsId; this.resultsId = detailsId;
    /*create a div for a row within the results table*/ var detailDiv = document.createElement("div"); detailDiv.className = this.displayRowClass; detailDiv.appendChild(document.createTextNode("<img src='/_layouts/images/loading.gif' />")); detailsDiv.appendChild(detailDiv);
    /*Add the results below the filters*/ document.getElementById(this.divId).appendChild(detailsDiv); for (var i = 0; i < this.filterFields.length; i++) { var selectedFieldArray = []; this.selectedFilters.push(selectedFieldArray); } if (this.notificationEnabled) { this.removeLoading(this); } applyFilter(null, this); }
    function DeHoverFilterLabel(labelel, parent) { var sourcelabel = labelel.srcElement; if (typeof (sourcelabel) == "undefined") { sourcelabel = labelel; } var checkboxid = sourcelabel.getAttribute("checkbox"); var el = document.getElementById(checkboxid); if (el.checked) { sourcelabel.className = parent.filterLabelSelectClass; } else if (sourcelabel.getAttribute("unused") == "unused") { sourcelabel.className = parent.filterLabelUnusedClass; } else { sourcelabel.className = parent.filterLabelClass; } }
    function SelectFilterLabel(labelel, parent) { var sourcelabel = labelel.srcElement; if (typeof (sourcelabel) == "undefined") { sourcelabel = labelel; hover = false; } var checkboxid = sourcelabel.getAttribute("checkbox"); var el = document.getElementById(checkboxid); if (el.checked) { sourcelabel.className = parent.filterLabelSelectClass; } }
    function HoverFilterLabel(labelel, parent) { var sourcelabel = labelel.srcElement; var hover = true; if (typeof (sourcelabel) == "undefined") { sourcelabel = labelel; } var checkboxid = sourcelabel.getAttribute("checkbox"); var el = document.getElementById(checkboxid); if (el.checked) { sourcelabel.className = parent.filterLabelSelectClass; } else if (sourcelabel.getAttribute("unused") == "unused") { sourcelabel.className = parent.filterLabelUnusedClass; } else if (hover) { sourcelabel.className = parent.filterLabelHoverClass; } else { sourcelabel.className = parent.filterLabelClass; } }
    function toggleAndApplyFilter(labelel, parent) { var sourcelabel = labelel.srcElement; if (typeof (sourcelabel) == "undefined") { sourcelabel = labelel; } var checkboxid = sourcelabel.getAttribute("checkbox"); var el = document.getElementById(checkboxid); var select = false; if (el.checked) { el.checked = false; } else { el.checked = true; select = true; } parent.applyFilter(el, parent); if (select) { sourcelabel.className = parent.filterLabelSelectClass; } else { sourcelabel.className = parent.filterLabelHoverClass; } }
    function applyFilter(el, parent) { var localNull = null; var resultcount = 0; if (el != localNull) { var element = el.srcElement; if (typeof (element) == "undefined") { element = el; } SelectFilterLabel(document.getElementById(element.getAttribute("label")), parent); var filter = element.value; var parentNode = element.parentNode; var tempElement = element.parentNode; while (tempElement.getAttribute("index") == localNull) { tempElement = tempElement.parentNode; } var fieldIndex = tempElement.getAttribute("index"); var elements = document.getElementsByName(element.getAttribute("name")); for (var inc = 0; inc < elements.length; inc++) { var thisel = elements[inc]; if (typeof (thisel.getAttribute("label")) != "undefined") { DeHoverFilterLabel(document.getElementById(thisel.getAttribute("label")), parent); } } if (element.checked) {
    if (parent.selectModes[fieldIndex] == "radio") { /*remove all other filters in this field.*/ parent.selectedFilters[fieldIndex] = []; } if (!containsString(parent.selectedFilters[fieldIndex], filter)) { parent.selectedFilters[fieldIndex].push(filter); } } else { var index = getIndexOf(parent.selectedFilters[fieldIndex], filter); if (typeof (index) != "undefined") { parent.selectedFilters[fieldIndex].splice(index, 1); } } } var resultsOuterDiv = document.createElement("div"); resultsOuterDiv.className = parent.displayTableClass; document.getElementById(parent.resultsId).innerHTML = ""; document.getElementById(parent.resultsId).appendChild(resultsOuterDiv); var resultsHeaderDiv = document.createElement("div"); resultsHeaderDiv.className = parent.displayRowClass; for (var i = 0; i < parent.displayNames.length; i++) { var headerCell = document.createElement("div"); headerCell.className = parent.displayHeaderClass; headerCell.innerHTML = parent.displayNames[i]; resultsHeaderDiv.appendChild(headerCell); }
    resultsOuterDiv.appendChild(resultsHeaderDiv); for (var i = 0; i < parent.potentialFilters.length; i++) { parent.potentialFilters[i] = []; /*initialize an array of empty arrays (one per filter)*/ } for (var i = 0; i < parent.items.length; i++) { /*for each item...*/ var itemfields = parent.items[i].filterValues var itemContainsAllSelectedValues = true; for (var j = 0; j < parent.selectedFilters.length; j++) { /*for each filter field*/ for (var k = 0; k < parent.selectedFilters[j].length; k++) { /*for each selected filter value*/ if (parent.selectedFilters[j].length == 0) continue; /*skip it if nothing is selected.*/ var thisvalue = parent.items[i].filterValues[j]; /*check if the item has that value within that field*/ if (!containsString(thisvalue, parent.selectedFilters[j][k], this.showMetadataGuids)) { itemContainsAllSelectedValues = false; break; } if (!itemContainsAllSelectedValues) break; } }
    if (itemContainsAllSelectedValues) { resultcount++; var rowDiv = document.createElement("div"); rowDiv.className = parent.displayRowClass; for (var j = 0; j < parent.items[i].displayValues.length; j++) { var cellDiv = document.createElement("div"); cellDiv.className = parent.displayCellClass; cellDiv.innerHTML = parent.items[i].displayValues[j]; rowDiv.appendChild(cellDiv); } for (var j = 0; j < parent.items[i].filterValues.length; j++) { for (var k = 0; k < parent.items[i].filterValues[j].length; k++) { parent.potentialFilters[j].push(parent.items[i].filterValues[j][k]); } } resultsOuterDiv.appendChild(rowDiv); } } if (resultcount == 0) { var rowDiv = document.createElement("div"); rowDiv.className = parent.displayRowClass; var cellDiv = document.createElement("div"); cellDiv.className = parent.displayCellClass; cellDiv.innerHTML = "No results were found for the specified criteria."; rowDiv.appendChild(cellDiv); resultsOuterDiv.appendChild(rowDiv); }
    /*Stylize dead-end filter options*/ for (var i = 0; i < parent.filterValueLists.length; i++) { for (var j = 0; j < parent.filterValueLists[i].length; j++) { var labelid = "label_" + i + "_" + j; var checkboxid = "js_mf_" + i + "_" + j; var filterCheck = document.getElementById(checkboxid); var fieldValue = parent.filterValueLists[i][j]; var tempElement = filterCheck.parentNode; while (tempElement.getAttribute("index") == localNull) { tempElement = tempElement.parentNode; } var fieldIndex = tempElement.getAttribute("index"); if (!containsString(parent.potentialFilters[fieldIndex], fieldValue, parent.showMetadataGuids)) { document.getElementById(labelid).className = parent.filterLabelUnusedClass; document.getElementById(labelid).setAttribute("unused", "unused"); } else { if (document.getElementById(checkboxid).checked) { document.getElementById(labelid).className = parent.filterLabelSelectClass; } else { document.getElementById(labelid).className = parent.filterLabelClass; }
    document.getElementById(labelid).setAttribute("unused", "false"); } } } var resultCountId = "js_mf_resultcount"; var resultCountDiv; if (document.getElementById(resultCountId) == null) { resultCountDiv = document.createElement("div"); resultCountDiv.id = "js_mf_resultcount"; resultCountDiv.className = parent.resultCountClass; document.getElementById(parent.divId).appendChild(resultCountDiv) } else { resultCountDiv = document.getElementById(resultCountId); } if (resultcount == 1) { resultCountDiv.innerHTML = resultcount + " result"; } else { resultCountDiv.innerHTML = resultcount + " results"; } }
    function onQueryFailed(sender, args) { this.removeLoading(this); this.document.getElementById(this.divId).innerHTML = 'The page was unable to populate the data this time.' + '<br/><span style="color:white">' + args.get_message() + '</span>\n'; }
    function get_defaultCss(useTheseClasses, includeStyleTags) { if (typeof useTheseClasses != "boolean") useTheseClasses = true; if (useTheseClasses) { this.filterHeadingClass = "js_Heading"; this.filterTableClass = "js_MFFilterTable"; this.filterColumnClass = "js_MFFilterColumn"; this.filterCheckboxClass = "js_MFFilterCell"; this.displayOuterClass = "js_MFResultOuter"; this.displayTableClass = "js_MFResultTable"; this.displayRowClass = "js_MFResultRow"; this.displayHeaderClass = "js_MFResultHeader"; this.displayCellClass = "js_MFResultCell"; this.filterLabelClass = "js_MFFilterLabel"; } if (typeof includeStyleTags != "boolean") includeStyleTags = false; var openstyletag = ""; var closestyletag = ""; if (includeStyleTags) { openstyletag = "<style>"; closestyletag = "</style>"; } var leftright_padding = "padding-left:2px;padding-right:2px;"; var tableLayoutFixed = ""; var filterTableLayoutFixed = ""; if (this.evenColumnWidths || this.dockResultHeaders) { tableLayoutFixed = "table-layout:fixed; "; }
    if (this.evenFilterColumnWidths) { filterTableLayoutFixed = "table-layout:fixed; "; } return openstyletag + "." + this.filterHeadingClass + "{font-weight:bold;background:#DDDDDD;text-align:center;}." + this.filterTableClass + "{background:#EEEEEE;display:table;width:100%;"+filterTableLayoutFixed+"}." + this.filterColumnClass + "{ display:table-cell;border-left:1px solid #CCC; border-right:1px solid #CCC;}." + this.filterCheckboxClass + "{padding-left: 5px;}." + this.displayOuterClass + "{height:" + this.maxResultHeight + "; overflow:auto; border:1px solid #CCC;}." + this.displayTableClass + "{display:table; " + tableLayoutFixed + "width:100%; text-align:left;}." + this.displayRowClass + "{width:100%;text-align:left;display:table-row;border-bottom:1px solid #EEEEEE;}." + this.displayHeaderClass + "{background:gray;color:white;display:table-cell; padding:5px; font-weight:bold;}." + this.displayCellClass + "{border-right:solid #CCC 1px; " + "border-left:0px;border-top:0px;border-bottom:1px solid #EEEEEE;"
    + "display:table-cell;padding:5px;}." + this.innerFilterColumnClass + "{float:left;}." + this.filterLabelClass + "{margin:1px; cursor:pointer;" + leftright_padding + "}." + this.filterLabelHoverClass + "{cursor:pointer; margin:1px;text-decoration:underline;" + leftright_padding + "}." + this.filterLabelSelectClass + "{background: #555; color:white; cursor:pointer; border:1px solid #555;" + leftright_padding + "}." + this.filterLabelUnusedClass + "{color:#bbb;margin:1px;cursor:default;" + leftright_padding + "}." + this.resultCountClass + "{text-align:right;font-weight:bold;}" + closestyletag; }
    function fieldIsLookup(field) { return (typeof field.get_lookupValue == 'function'); }
    function fieldIsDate(field) { return (typeof field._toFormattedString == 'function'); }
    function fieldIsHyperlink(field) { return (typeof field.get_url == 'function'); }
    function fieldIsText(field) { return (typeof field == 'string'); }
    /* HELPER FUNCTIONS*/
    /* Helper function to imitate Array.contains() method */ function containsString(strArray, text, showMetadataGuids) { if (typeof (showMetadataGuids) == "undefined") { showMetadataGuids = true; } var contains = false; for (i in strArray) { if (strArray[i] == text) { contains = true; break; } else if (showMetadataGuids == false) { if (strArray[i].indexOf('|') != -1) { if (strArray[i].split('|')[0] == text) { contains = true; break; } } } } return contains; }
    /* Helper function to imitate Array.indexOf() method */ function getIndexOf(strArray, text) { for (i in strArray) { if (strArray[i] == text) return i; } }
    return js_MultiFilter;})();
    Then you can reference the JS file and put the filter control on your page like so:
    <div id="js_MultiFilterExample"><img src="/_layouts/images/loading.gif"/></div>
    <script src="/[wherever you saved your js file]/js_MultiFilter.js"></script>
    <script>
    ExecuteOrDelayUntilScriptLoaded(newInstance, "sp.js");
    function newInstance(){
    var mf = new js_MultiFilter("Library Name"); // pass the list display name
    //// Optional Parameters
    //mf.maxResultHeight = "100%"; // set the max height of the results (default: "270px")
    mf.sortField = "FileLeafRef"; // specify internal name of field to sort results by (default: Title)
    //mf.sortDesc = true; // sort descending (default: false)
    //mf.evenColumnWidths = false; // equal result column widths (disable at own risk) (default: true)
    mf.evenFilterColumnWidths = false; // equal filter column widths (default: true)
    //mf.rowLimit = 500; // increase the result row limit imposed on the query (default: 100)
    //mf.notificationEnabled = false; // show the fly-out Loading notification (default: true)
    //mf.selectMode = "radio"; // Specify the default select mode i.e. checkbox or radio (default: checkbox)
    //mf.showMetadataGuids = true; // Do not trim the GUID suffix from managed metadata filters (default: false)
    //mf.maxFilterHeight = 20 ; // Specify the maximum number of options to display in a column before adding another column (default: 13)
    //// Filter and Display Fields
    mf.addFilterField("Category","Category","radio"); // (internal name, display name (optional), select mode (optional))
    mf.addFilterField("Tags");
    //// addDisplayField() displays an additional field from each list item
    //// addStaticDisplayField() adds a column that displays the same text for every item
    mf.addDisplayField("FileLeafRef","Link to Doc","fileref"); // (internal name, display name (optional), display mode (optional))
    mf.addStaticDisplayField("View Properties","Display Form","display"); // (display text, display name (optional), display mode (optional))
    mf.addDisplayField("Author","Created By");
    mf.addDisplayField("Modified");
    //// Valid display modes are: default (display value as text), link (treat the value as a hyperlink),
    //// display (link to library display form), edit (link to library edit form), and fileref (link to document)
    //// CSS classes used by the control
    //mf.filterHeadingClass = "js_MFFilterHeading";
    //mf.filterTableClass = "js_MFFilterTable";
    //mf.filterColumnClass = "js_MFFilterColumn";
    //mf.filterInnerColumnClass = "js_MFInnerFilterColumn";
    //mf.filterCheckboxClass = "js_MFFilterCell";
    //mf.displayOuterClass = "js_MFResultOuter";
    //mf.displayTableClass = "js_MFResultTable";
    //mf.displayRowClass = "js_MFResultRow";
    //mf.displayHeaderClass = "js_MFResultHeader";
    //mf.displayCellClass = "js_MFResultCell";
    //mf.filterLabelHoverClass = "js_MFFilterHoverLabel";
    //mf.filterLabelSelectClass = "js_MFFilterSelectLabel";
    //mf.filterLabelUnusedClass = "js_MFFilterUnusedLabel";
    //mf.resultCountClass = "js_MFResultCount";
    mf.insertDefaultCss();
    mf.bindToDiv("js_MultiFilterExample");
    </script>
    Uncomment anything you need to change!

  • GROUP BY: determinstic function column of group by expression 10g vs 11g

    The following works in 10g but now fails in 11g.
    Simple description: If I create a view of a number and subtract 2 from that number
    and I group by the first column and include the 2nd column, it works in 10g and gives "not a group by column" in 11g.
    It seems that 10g knew the 2nd column was derived by the first column so grouping by the 1st column gave an automatic pass to the 2nd column.
    11g seems to be more strict (though I don't know why, if the 2nd column's function is purely deterministic as you would expect subtracting by 2 would be. Same is true for UPPER())
    Is there a reason for this change in behaviour in 11g?
    Is there some explicit reason for the change in functionality?
    Exact versions and results below
    Line: -----
    Connected to:
    Oracle Database 10g Release 10.2.0.3.0 - Production
    SQL> drop view v1;
    View dropped.
    SQL> drop view v2;
    View dropped.
    SQL>
    SQL> create view v1 as
    2 select '0' c1, 0 c2 from dual
    3 union all
    4 select '1', 1 from dual
    5 union all
    6 select '2', 2 from dual
    7 union all
    8 select '3', 3 from dual;
    View created.
    SQL>
    SQL>
    SQL> create view v2
    2 as select c1, upper(c1) c1u, c2, c2-2 c3
    3 from v1;
    View created.
    SQL>
    SQL> select c1, c1u
    2 from v2
    3 group by c1;
    C C
    1 1
    3 3
    0 0
    2 2
    SQL>
    SQL> select c1, c2, c3
    2 from v2
    3 group by c1, c2;
    C C2 C3
    1 1 -1
    3 3 1
    2 2 0
    0 0 -2
    -- =============================================================================================
    Connected to:
    Oracle Database 11g Release 11.2.0.1.0 - 64bit Production
    SQL> drop view v1;
    View dropped.
    SQL> drop view v2;
    View dropped.
    SQL>
    SQL> create view v1 as
    2 select '0' c1, 0 c2 from dual
    3 union all
    4 select '1', 1 from dual
    5 union all
    6 select '2', 2 from dual
    7 union all
    8 select '3', 3 from dual;
    View created.
    SQL>
    SQL>
    SQL> create view v2
    2 as select c1, upper(c1) c1u, c2, c2-2 c3
    3 from v1;
    View created.
    SQL>
    SQL> select c1, c1u
    2 from v2
    3 group by c1;
    select c1, c1u
    ERROR at line 1:
    ORA-00979: not a GROUP BY expression
    SQL>
    SQL> select c1, c2, c3
    2 from v2
    3 group by c1, c2;
    select c1, c2, c3
    ERROR at line 1:
    ORA-00979: not a GROUP BY expression
    Edited by: joriotis on Jul 25, 2011 11:01 AM
    Edited by: joriotis on Jul 25, 2011 11:03 AM

    Hi,
    Just 4 hours ago, someone else had a very similar question:
    Group by fails on ORA-00979
    Personally, I consider that a bug in Oracle 10. When you do a GROUP BY on a view, you can't expect the SQL engine to look at the view definition, and determine if one of the columns can be derived from another.
    In practice, it's easy enough to add c1u to the GROUP BY clause, or to use MAX (c1u) instead of c1u, to make your query work.

  • Group by for one column

    there is a scenario in informatica..where we can select more than one rows and group by on only one row..its possible in informatica..
    so can any one tell how to sql for those type of scenarios
    For example there are
    SEQUENCE_ID NUMBER NOT NULL,
    SAT_ID VARCHAR2(30 BYTE) NOT NULL,
    MFG_ID VARCHAR2(99 BYTE),
    SOLD_DT DATE,
    VIN VARCHAR2(30 BYTE)
    HE IS SELECTING ALL THE COLUMNS AND GROUPING BY ON SAT_ID ..so do any one tell how to write sql in that scenario

    in oracle you can have groupings without having to group all of the columns in the select clause by using an analytic query.
      select a.*
        from (select sequence_id,
                     mfg_id,
                     sold_dt,
                     vin,
                     row_number() over (partition by mfg_id order by sold_dt) rn
                from <table>
               where <conditions>) a
       where a.rn = 1
    try to post some sample data and output. we might be able to come up with some simple query that might be compatible or supported by informatica queries.

  • Error in nested group function used with column name.

    Hi Team,
    If i used nested group function with column name its not working. Could you please any one suggest me.
    How to use it.
    Regards,
    Venkat.
    Please find Spool ........
    SQL> select user_name,max(max(CNT)) from (select USER_NAME,count(*) CNT from v$open_cursor group by USER_NAME)
    2 group by user_name,CNT;
    select user_name,max(max(CNT)) from (select USER_NAME,count(*) CNT from v$open_cursor group by USER_NAME)
    ERROR at line 1:
    ORA-00937: not a single-group group function
    SQL> select max(max(CNT)) from(select USER_NAME,count(*) CNT from v$open_cursor group by USER_NAME)
    2 group by user_name;
    MAX(MAX(CNT))
    605

    Venkat wrote:
    Hi Sayan
    Its giving output like below, but not given maximum CNT.
    SQL> select user_name,max(CNT)from (select USER_NAME,count(*) CNT from v$open_cursor group by USER_NAME)
    2 group by user_name;
    USER_NAME MAX(CNT)
    BANES_LERG 6
    VENE_USER 8
    USER3 339
    DBUS 106
    VEL_USER 37
    SYS 597
    6 rows selected.Check it - Re: Error in nested group function used with column name.
    and previous post

  • Use the for-each to group the element across in output

    I have the report in XMLP for which we need to design the template to generate the output in excel. we need to group the element across the report. by default the for-each group the element top-down, is there any option to group the elements across. example:
    consider the xml data as
    <?xml version="1.0"?>
    <XXFA_TAL_REP_XMLP>
    <LIST_G_DAY_WE_EXECUTED>
    <G_DAY_WE_EXECUTED>
    <DAY_WE_EXECUTED>18-NOV-09</DAY_WE_EXECUTED>
    </G_DAY_WE_EXECUTED>
    <G_DAY_WE_EXECUTED>
    <DAY_WE_EXECUTED>19-NOV-09</DAY_WE_EXECUTED>
    </G_DAY_WE_EXECUTED>
    </LIST_G_DAY_WE_EXECUTED>
    </XXFA_TAL_REP_XMLP>
    if we group by the above data with group G_DAY_WE_EXECUTED and try to print the data element - DAY_WE_EXECUTED we will get two fields as below
    18-NOV-09 - in excel cell A1
    19-NOV-09 - in excel cell A2
    but we need to have these fields in excel cells - A1 & B1
    Please help me to achieve this.
    ~ Ashish | 630 487 9486

    Can you try with
    for-each@column

  • Grouping Via Week Ending Date

    Hi All,
    I have transaction line data for each day for our customer and i would like to group via Week Ending date.  Our week runs from Sunday to Saturday.
    If i Add the transaction date to the group expert it allows me to group via week(perfect) but does it via week commencing.  I see you can group via formula, does any one know how you can get the grouping via Week Ending.
    thanks for any help and advise.
    mike

    Try using this formula...
    DateAdd("ww", DateDiff("ww", #1/6/1900#, {TableName.DateField}), #1/6/1900#)
    This formula will calculate the "Following Saturday" for any given date. If the date supplied is a Saturday, it will return that same date.
    So...
    11/2/2010 &gt; 11/6/2010
    11/13/2010 &gt; 11/13/2010
    11/14/2010 &gt; 11/20/2010
    HTH,
    Jason

  • Capacity requirement group by week

    Inside CM01, given a work center,  we can get capacity requirements group by weeks.
    Is there any function module to get the same answer?
    I've found that table KBED seems to hold the information I need.
    But don't know how to group the records into different slot of week.
    Can anybody help?
    Regards,
    Norman.

    Hi,
    user588757 wrote:
    Hi Frank,
    Too good... it worked !!!!!!!!!!!!Thanks. If it's too good, I suppose you can always add errors.
    And can we give input for END DATE...it does have only start date..Yes, you could give the end date instead of the start date.
    You could allow either.
    Suppose you had a form that returned user_input_date (a DATE) and a string, user_date_type, returned by a radio group, 'START' if the user indicated that the date entered was a start date, or 'END' otherwise.
    WITH  d  AS
        SELECT  user_input_date -     CASE
                             WHEN  user_date_type = 'START'
                             THEN  0
                             ELSE  6
                        END     AS input_startdate
    ,     g  AS
        SELECT  (creation_date - input_startdate)  AS wk_num
        FROM    xxsirf_per_addresses_tl
        CROSS JOIN  d
    SELECT    MAX (input_startdate + (7 * wk_num))          AS wk_start
    ,         MAX (input_startdate + (7 * wk_num) + 6)     AS wk_end
    ,         COUNT (*)
    FROM      g
    GROUP BY  wk_num
    ORDER BY  wk_num;Though if you were running this from a form, it would be easy to do sub-query d separately, and pass the input_startdate that it computed to the query I posted earlier.
    I would discourage allowing users to input both start- and end dates, because they won't necessarily be six days apart.
    Of course, you could ignore one if both were entered, but that's exactly the kind of thing that confuses end users.

  • GROUP BY with multiple columns.

    I have little query about GROUP BY clause.
    Sometimes we will give multiple column names in GROUP BY .If it behaves in the same way as ORDER BY (multiple columns) i would love to have an example where I can use GROUP BY multiple columns. Anyways howsoever it behaves it will be really appreciated if anyone can explain a scenario where GROUP BY with multiple columns can be used.
    I know about the usage of aggregate functions with GROUP BY but using only one column.
    Thanks..!!!

    Hi,
    Group by is used for grouping of same records. check this bellow scenario
    SELECT registrationid, dateofbirth, age FROM prawin62 WHERE registrationid = 22;
    22     1/23/1975     54
    22     5/18/2011     66
    22     5/18/2011     66
    22     5/18/2011     66
    22     5/18/2011     66
    22     5/18/2011     66SELECT registrationid, sum(age) FROM prawin62 WHERE registrationid = 22 GROUP BY registrationid;
    22     384SELECT registrationid, dateofbirth, sum(age) FROM prawin62 WHERE registrationid = 22 GROUP BY registrationid, dateofbirth ;
    22     5/18/2011     330
    22     1/23/1975     54Thanks,
    Praveen

  • Repeat group header in multiple columns

    I have a group and the details section is set to format with multiple columns.  I have the repeat group header on each page option checked but I also want it to repeat group header if the group spans multiple columns.  Does anyone know how to do this?

    Thanks for your reply but I'm not sure how you copy a group header into another column if the data that is displayed there is dynamically displayed.  Please advise.  Thanks

  • Dragging one cell value(copy) across columns or across rows in ALV layout

    Hi friends,
    In bps layouts, data is displayed in ALV grid as interface. At plng folder level, can i incorporate excel feature like dragging one cell value across columns or across rows?  Simply if user enter one value in cell of ALV grid, that should be copied automatically across rows/columns while dragging?
    Second question, even i chose in layout builder excel as interface, that layout showed in plng folder as ALV grid layout. Why it happens so. I read documentation in UPSPM of that particular plng folder, it tells same thing(even if u choose excel, it will show in ALV only). So how can i get excel interface in plng folder?
    Regards,
    Kumar

    requested property is not possible at ALV layout level. Provided text document load facility to user. So user can directly load excel to plng folder.
    Issue resolved.

  • How to get sum amount (wrbtr) from table BSIS group by gjahr hkont monat

    Hello! I am new to this forum, and to ABAP. Hope my question is not obvious.
    I want to get sum amount from table BSIS, group by year, period an account. Normally I will try a SQL select like this:
    SELECT gjahr monat hkont sum( wrbtr ) as wrbtr INTO CORRESPONDING FIELDS OF TABLE itab FROM BSIS WHERE (itabcond) GROUP BY gjahr monat hkont .
    The problem is that the amount in field wrbtr is all positive. The result gets wrong. The debet/credit indicator shkzg determines what is positive/negative. How to solve this in the most efficient way? Should I read all accounting documents into an internal table, and loop through them, changing the sign, and then make some new select, or is there a better way?
    Regards Dag-Egil
    Message was edited by:
            Dag-Egil Bull Sletholt

    Here are the objects in the trace list:
    SKB1
    USR05
    TRDIR
    SKA1
    SKAT
    SKB1
    BSIS
    PRPS
    BSAS
    V_LTDX
    USR02
    RFBLG
    V_LTDX
    LTDX
    RTXTH
    RTXTF
    RTXTT
    TRDIR
    The most of this call to this tables returns 1-2 records, apart from BSIS, where it returns 10 records. This is the same as accounting documents in the transaction FBL3N. When i try this again with more records returned I still have no call to table GLT0.

Maybe you are looking for

  • Windows Defender not working in Windows 8.1

    My Windows Defender isn't working. It says update failed and cannot turn on real protection

  • Wanting to buy Iphone

    To Whom It May Concern, I want to buy a phone/pda that is for my business activities...is Iphone's To Do List and Calender function really good? easy to use? can anyone share your experience with me...so I can really make sure I can buy Iphone

  • JTextPane and Clipboard

    Hi! I am using JDK 1.3 and JDK 1.4 and I've got the following question: If I use the javax.swing.JTextPane object, I can define a javax.swing.text.DefaultEditorKit and other actions in order to implement copy/paste functionality. My question is: Whic

  • Use of webservices

    Hi,    what is the exact use of webservices.. and  in which scenario we can go for webservices... and is there any types are there  under web services ? any PDF  is there plz send it to my mail id : [email protected] plz clarrify  this .. thanks babu

  • AB AP (BDC) to launch 3rd party printing application

    Hi all, i intend to create a BDC program to generate PDF file. Unfortunately, due to system constraint (4.6B), unable to convert SAP document directly to PDF in the system (using FM) so have to use a 3rd party software. currently i have a 3rd party s