Adding multiple columns in List Validation
HI,
I have a custom list, which has 2 date fields. In the date column, I have added a validation as below for each of the columns:
//on column one - Test Log date=[Test Log date]>=TODAY()
//on column two - Test Start date=[Test Start date]>=TODAY()
and the validation message for each of the column as : "Please enter date greater than or equal to today's date"
In the Edit mode, i dont want the validation to check.
How to add these two fields in the list validation?
Thanks
Hi,
According to your post, my understanding is that you want to disable column validation in the edit form.
There is no out of the box way to disable column validation only in edit form.
As a workaround, we can use the JQuery to create our own custom column validation in the new form.
There is an article about this topic, you can have a look at it.
http://www.c-sharpcorner.com/UploadFile/3a164c/custom-validations-in-sharepoint-form-using-jquery/
Thanks,
Jason
Forum Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
[email protected]
Jason Guo
TechNet Community Support
Similar Messages
-
Hello, Trying to make multiple column ordered lists in dreamweaver where the first column is 1,2,3,4 the second column is A,B,C,D and the third is I, II, III, IV. I have tried tables but the numbers, letters and roman numerals disappear
1. John A. John I. John
2. Mark B. Mark II. Mark
3. Jim C. Jim III. Jim
4. Roni D. Roni IV. Roni
Any help would be much appreciatedUse ordered list .classes inside floated containers.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Floated Lists</title>
<style type="text/css">
#wrapper {
/**width of floats, borders, etc...**/
width: 606px;
background: #EAEAEA;
overflow: hidden; /**float containment**/
.floatLt {
float:left;
width: 200px;
border: 1px solid silver;}
.floatRt {
float:right;
width: 200px;
border: 1px solid silver}
/**ordered lists**/
.alpha li {list-style:upper-alpha}
.decimal li {list-style:decimal;}
.roman li {list-style:lower-roman;}
</style>
</head>
<body>
<div id="wrapper">
<div class="floatLt">
<ol class="alpha">
<li>List item</li>
<li>List item</li>
<li>List item</li>
<li>List item</li>
</ol>
</div>
<div class="floatLt">
<ol class="decimal">
<li>List item</li>
<li>List item</li>
<li>List item</li>
<li>List item</li>
</ol>
</div>
<div class="floatRt">
<ol class="roman">
<li>List item</li>
<li>List item</li>
<li>List item</li>
<li>List item</li>
</ol>
</div>
<!--end #wrapper --></div>
</body>
</html>
Nancy O.
Alt-Web Design & Publishing
Web | Graphics | Print | Media Specialists
http://alt-web.com/
http://twitter.com/altweb -
*Help Needed* Adding multiple emails/mailing list in the email subscription
Help Needed
Hi,
Can someone help me in adding multiple email address/mailing list in the email subscription for interactive reports in Apex 4.
pls mail me at [email protected]
Regards,
SunnyThe doc does not mention a separator for the email addresses because we only support one email address per subscription. I have logged a task for our next release to look at expanding it and allowing multiple.
-- Sharon -
Hellow all
I have 3 Column Code,Name,Salary
I want a list item which show all 3 Data in one list item
The picture will Clear you my Requirement
Linkhttp://h1.ripway.com/Sharry2/ok.bmp
Regards
ShahzaibYou want a static list_item or a dynamic list item, which is populated by a select statement??
If you want a statis list item you can add your values from property palette; if you want a dynamic list item, I don't know if it is possible, because I have tried only with one column; you can try by make a concatenation of your columns separated by ','; for example you can try this code:
select col1||','||col2||','||col3 as your_column_name
from your table
where your conditionIf you use create_group_from_query built_in, make sure to write column name 2 times, because one is for value of list item and the other is for label.
Hope it helps you,
Fabrizio
If this answer is helpful or correct, please mark it. Thanks. -
Multiple Columns and List Order with Color
I am trying to take this code and enhance it by:
1. It currently displays the output in a 5 column vertical format
output1 output2 output3...
I want it to display in a scrolling 5 column vertical format
output1 output4
output2 output5
output3 output6
based on the number of data points
2. I want the first column background to be blue, the next white, the next blue, the next white, the last blue.
Any way to accomplish this..appreciate any help.
Leo
Code:
<table width="100%" border="0" cellpadding="7" cellspacing="0">
<tr>
<td colspan="5" align="left" valign="top" bgcolor="#CC6699">
<span class="datetextwhite"><a name="THURSDAY"> </a><span class="style6">Thursday, October 29th: PRE-CONFERENCE INTENSIVES</span></span></td>
</tr>
<TR>
<CFOUTPUT QUERY="q_daysschedule">
<TD valign=top><span class="bodytextbold"><span class="style16"><font face="Verdana, Arial, Helvetica, sans-serif">#q_daysschedule.time#</font></span></span><br /><span class="topNavigationBar"><a href="session.cfm?ID=201" class="topNavigationBar">#q_daysschedule.Title#</a></span></TD>
<CFIF q_daysschedule.CurrentRow MOD 5 IS 0>
</TR>
<TR></TR>
</CFIF>
</CFOUTPUT>
<tr>I find these problems easier to solve if I rearrange my data into an array. Something like this:
DataArray = ArrayNew(2);
Cols = 5;
Outputs = "output1,output2,etc";
Rows = Round(ListLen(Outputs) / Cols + .5); // 32 outputs would give you 7 rows
for (ii = 1; ii lt cols; ii = ii + 1) {
for (j = 1; j lte Rows; j = j + 1) {
DataArray[ii][j] = ListFirst(Outputs);
Outputs = ListRestOutputs;
} // rows
} // cols
// Last Column
for (ii = 1; ii lte ListLen(Outputs); ii = ii + 1 )
DataArray[cols][ii] = ListGetAt(outputs, ii);
// put spaces in blank rows
for (j = ii; j lte rows; j = j + 1)
DataArray[cols][j] = " ";
Output like this
<cfoutput>
<cfloop from = "1" to = cols index = "ThisRow">
<cfloop from = "1" to = rows index = "ThisCol">
#DataArray[ThisCol][ThisRow]#
closing tags, formatting etc -
Master-detail list - how to spread over multiple columns
I am using the master-detail functionality to create a image viewer.
I have a long list of master thumbnails, and rather than having them go down the page in one column, I would like to make them spread over 2 or 3 columns before the detail column.
(example of format I am trying to achieve - http://www.franbainbridgephotography.com.au/gallery.html (I dont mind whether master thumbnails are on right or left of detail photo))
You can see my problem on http://www.wcwra.com/webpages/images.php
Is this possible with the master-detail functionality?
Thank you!The brilliant David Powers has fixed this for me on the main forum (vw2ureg was v close). David's answer is :
There is no way of making a single dataset repeat in multiple columns, because it's simply one element being repeated over and over.
However, with a little out of the box thinking, you can do it quite easily with thumbnails. Instead of putting the master column repeat region in a block level element, use an inline element, <span>. Images are treated by browsers as inline elements, so this should work just fine. Change the following code from this:
<div spry:region="dsPhotos" class="MasterContainer">
<div class="MasterColumn" spry:repeat="dsPhotos" spry:setrow="dsPhotos"
spry:hover="MasterColumnHover" spry:select="MasterColumnSelected">{Caption}</div>
</div>
to this:
<div spry:region="dsPhotos" class="MasterContainer">
<span class="MasterColumn" spry:repeat="dsPhotos" spry:setrow="dsPhotos"
spry:hover="MasterColumnHover" spry:select="MasterColumnSelected">{Caption}</span>
</div>
In your CSS, set the width of the MasterColumn class to the width of your thumbnails, and the width of MasterContainer so that it's wide enough to accommodate two or more thumbnails. The thumbnails will flow into the column two or three abreast. -
Creating Select List with multiple columns
I want to create a select list with multiple columns. I followed the demo application model described in the by Denes Kubicek (Currently my reference for APEX !!)
The code is as follows:
CREATE OR REPLACE FUNCTION getcrops(p_cropid IN NUMBER)
RETURN VARCHAR2
IS
v_cropid VARCHAR2 (400);
v_fcode VARCHAR2 (400);
v_product VARCHAR2 (400);
v_var VARCHAR2 (400);
v_fname VARCHAR2 (400);
v_acres VARCHAR2 (400);
v_style_start VARCHAR2 (400);
v_style_end VARCHAR2 (400);
v_return VARCHAR2 (400);
BEGIN
FOR c IN (select "CROP"."CROPID" as "CROP ID",
"CROP"."FIELDCODE" as "FIELD CODE",
"CARROTPRODUCTLIST"."CARROTPRODUCTNAME" as "PRODUCT",
"VARIETYLIST"."VARIETYNAME" as "VARIETY",
"FIELD"."FIELDNAME" as "FIELD NAME",
"CROP"."SIZEINACRES" as "ACRES"
from "FIELD" "FIELD",
"CARROTPRODUCTLIST" "CARROTPRODUCTLIST",
"VARIETYLIST" "VARIETYLIST",
"CROP" "CROP"
where "CROP"."CARROTPRODUCTTYPE"="CARROTPRODUCTLIST"."CARROTPRODUCTID"
and "CROP"."VARIETYID"="VARIETYLIST"."VARIETYLISTID"
and "CROP"."FIELDID"="FIELD"."FIELDID")
LOOP
v_cropid := TO_CHAR (c.'CROP ID', 'FML999G999G999G999G990');
v_fcode := c.'FIELD CODE';
v_product := c.'PRODUCT';
v_var := c.'VARIETY';
v_fname :=c.'FIELD NAME';
v_acres :=c.'ACRES';
FOR i IN 1 .. 12 - LENGTH (c."CROP ID")
LOOP
v_cropid := v_cropid || ' ';
END LOOP;
FOR i IN 1 .. 12 - LENGTH (c.'FIELD CODE')
LOOP
v_fcode := v_fcode || ' ';
END LOOP;
FOR i IN 1 .. 12 - LENGTH (c.'PRODUCT')
LOOP
v_product := v_product || ' ';
END LOOP;
FOR i IN 1 .. 12 - LENGTH (c.'VARIETY')
LOOP
v_var := v_var || ' ';
END LOOP;
FOR i IN 1 .. 12 - LENGTH (c.'FIELD NAME')
LOOP
v_fname := v_fname || ' ';
END LOOP;
FOR i IN 1 .. 12 - LENGTH (c.'ACRES')
LOOP
v_acres := v_acres || ' ';
END LOOP;
v_return := v_cropid || v_fcode || v_product || v_var || v_fname || v_acres;
END LOOP;
RETURN v_return;
END;
I created this anonymous Pl/SQL function at a application level ..Then I followed up to create a select list with a function inside. However I could not create select list with the command suggested in the demo which is
select getcrops(cropid) d, cropid r from crop;
APEX (2.1) returns a error message. What am I missing ? Should the function be called from somewhere else after creating a regular select list..? Where the functions (Pl/SQL) should be ideally stored for application level access..? and for across application level access ? How can I check the function works good. Help is appreciated.Still really one column.
If they need to be independent then you've got to have three selection lists.
% -
Selection list with multiple columns
How can i create a selection list with multiple columns?
Still really one column.
If they need to be independent then you've got to have three selection lists.
% -
Select list with multiple columns
I want to create a select list with multiple column option. What are the options. Any developments in apex 3.0.1 ? Thanks in advance. I tried the tutorials by Kubicek.
I am kind of stuck to see the function entry inside LOV definition returns a error.Still really one column.
If they need to be independent then you've got to have three selection lists.
% -
hello all ,
how to create a list with multiple columns ? can anyone share some examples or code snippetsWhat I would usually do is create a movieclip/sprite that contains a row with every column in it (each column being a textfield). Then pile up the rows one atop the other (using Actionscript) as they are populated with data.
-
Dear All,
Anybody can help me in the scenario....
I want to display multiple columns (each column may contain multiple values) in java frame. What java control should i use? java.awt.List cannot show multiple columns. Remember the column and rows values which i want to display are not coming from database. It can be like i have an array for columns and array of row values for each column.
I would be grateful if someone email me the solution at [email protected]
Waiting for prompt reply.
Thanks
KamranWhat about AWT.table or Swing.JTable ?
-
Customized CQWP display only multiple columns after migration to 2013 when source is a list.
If I select Show items from all sites in this site collection or Show items from the following site and all subsites as Query source all my custom columns are with out value, if I select Show items from the following list every thing is as it should be.
(Se picture)
This is show multiple columns values correctly:
<webParts>
<webPart xmlns="http://schemas.microsoft.com/WebPart/v3">
<metaData>
<type name="Microsoft.SharePoint.Publishing.WebControls.ContentByQueryWebPart, Microsoft.SharePoint.Publishing, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
<importErrorMessage>Cannot import this Web Part.</importErrorMessage>
</metaData>
<data>
<properties>
<property name="Filter1ChainingOperator" type="Microsoft.SharePoint.Publishing.WebControls.ContentByQueryWebPart+FilterChainingOperator, Microsoft.SharePoint.Publishing, Version=15.0.0.0, Culture=neutral,
PublicKeyToken=71e9bce111e9429c">And</property>
<property name="FilterOperator1" type="Microsoft.SharePoint.Publishing.WebControls.ContentByQueryWebPart+FilterFieldQueryOperator, Microsoft.SharePoint.Publishing, Version=15.0.0.0, Culture=neutral,
PublicKeyToken=71e9bce111e9429c">Eq</property>
<property name="Direction" type="direction">NotSet</property>
<property name="FilterOperator3" type="Microsoft.SharePoint.Publishing.WebControls.ContentByQueryWebPart+FilterFieldQueryOperator, Microsoft.SharePoint.Publishing, Version=15.0.0.0, Culture=neutral,
PublicKeyToken=71e9bce111e9429c">Eq</property>
<property name="GroupByDirection" type="Microsoft.SharePoint.Publishing.WebControls.ContentByQueryWebPart+SortDirection, Microsoft.SharePoint.Publishing, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c">Asc</property>
<property name="DataSourceID" type="string" />
<property name="ChromeState" type="chromestate">Normal</property>
<property name="SystemViewFields" type="string" />
<property name="ListName" type="string">Document library</property>
<property name="FilterDisplayValue3" type="string" />
<property name="FilterDisplayValue2" type="string">5.7.2</property>
<property name="FilterDisplayValue1" type="string">HCM/Payroll</property>
<property name="FilterField1" type="string">SectionName</property>
<property name="Description" type="string">Use to display a dynamic view of content from your site on a web page</property>
<property name="DataColumnRenames" type="string" />
<property name="MissingAssembly" type="string">Cannot import this Web Part.</property>
<property name="PageSize" type="int">-1</property>
<property name="ViewContentTypeId" type="string" />
<property name="ParameterBindings" type="string" null="true" />
<property name="HelpUrl" type="string" />
<property name="AdditionalFilterFields" type="string" />
<property name="DataMappingViewFields" type="string">{fa564e0f-0c70-4ab9-b863-0177e6ddd247},Text;</property>
<property name="Title" type="string">Prod CQWP</property>
<property name="FeedDescription" type="string" />
<property name="UseCache" type="bool">True</property>
<property name="XslLink" type="string" null="true" />
<property name="AutoRefresh" type="bool">False</property>
<property name="Filter1IsCustomValue" type="bool">False</property>
<property name="FireInitialRow" type="bool">True</property>
<property name="FilterValue3" type="string" />
<property name="SortByFieldType" type="string">DateTime</property>
<property name="ManualRefresh" type="bool">False</property>
<property name="HelpMode" type="helpmode">Modeless</property>
<property name="AllowConnect" type="bool">True</property>
<property name="ItemStyle" type="string">DesignDocumentsTest</property>
<property name="SampleData" type="string"><dsQueryResponse>
<Rows>
<Row Title="Item 1" LinkUrl="http://Item1" Group="Group Header" __begincolumn="True"
__begingroup="True" />
<Row Title="Item 2" LinkUrl="http://Item2" __begincolumn="False" __begingroup="False"
/>
<Row Title="Item 3" LinkUrl="http://Item3" __begincolumn="False" __begingroup="False"
/>
</Rows>
</dsQueryResponse></property>
<property name="FilterIncludeChildren2" type="bool">False</property>
<property name="XmlDefinitionLink" type="string" />
<property name="ServerTemplate" type="string">101</property>
<property name="TitleUrl" type="string" />
<property name="CommonViewFields" type="string">Title,Text;Product_x0020_Name,Choice;Areabranch,Choice;ProdcutDesignDocCategory,Choice;User_x0020_Story,Text;Status,Choice</property>
<property name="QueryOverride" type="string" />
<property name="DataSourcesString" type="string" />
<property name="DisplayName" type="string" />
<property name="ListGuid" type="string">ce5f8d8e-6ab9-4ed1-8c10-557362473348</property>
<property name="DataFields" type="string" />
<property name="ShowWithSampleData" type="bool">False</property>
<property name="GroupByFieldType" type="string">Choice</property>
<property name="Default" type="string" />
<property name="ViewFlags" type="Microsoft.SharePoint.SPViewFlags, Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c">None</property>
<property name="ContentTypeBeginsWithId" type="string">0x010100634C5EFE866C834E92467F3F8D9C37C7080401</property>
<property name="AllowHide" type="bool">True</property>
<property name="FeedEnabled" type="bool">False</property>
<property name="SortBy" type="string">Modified</property>
<property name="FilterByContextTerm" type="bool">False</property>
<property name="TitleIconImageUrl" type="string" />
<property name="PlayMediaInBrowser" type="bool">True</property>
<property name="ViewFlag" type="string">0</property>
<property name="Xsl" type="string"><xsl:stylesheet xmlns:x="http://www.w3.org/2001/XMLSchema" version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:cmswrt="http://schemas.microsoft.com/WebPart/v3/Publishing/runtime" exclude-result-prefixes="xsl cmswrt x" > <xsl:import href="/Style Library/XSL Style Sheets/Header.xsl" /> <xsl:import href="/Style
Library/XSL Style Sheets/ItemStyle.xsl" /> <xsl:import href="/Style Library/XSL Style Sheets/ContentQueryMain.xsl" /> </xsl:stylesheet></property>
<property name="FilterField2" type="string">Product_x0020_Version</property>
<property name="ChromeType" type="chrometype">TitleOnly</property>
<property name="CacheXslTimeOut" type="int">86400</property>
<property name="AdditionalGroupAndSortFields" type="string" />
<property name="UseSQLDataSourcePaging" type="bool">True</property>
<property name="Height" type="string" />
<property name="DataMappings" type="string">User_x005F_x0020_Story:|LinkUrl:|Description:|OpenInNewWindow:|Product_x005F_x0020_Name:|Areabranch:|ImageUrl:|Title:{fa564e0f-0c70-4ab9-b863-0177e6ddd247},Title,Text;|LinkToolTip:|ProdcutDesignDocCategory:|Status:|SipAddress:|</property>
<property name="ListUrl" type="string" null="true" />
<property name="ShowUntargetedItems" type="bool">False</property>
<property name="AllowMinimize" type="bool">True</property>
<property name="GroupBy" type="string">Areabranch</property>
<property name="FilterIncludeChildren1" type="bool">False</property>
<property name="BaseType" type="string" />
<property name="MainXslLink" type="string" />
<property name="AsyncRefresh" type="bool">False</property>
<property name="FilterValue1" type="string">HCM/Payroll</property>
<property name="FilterValue2" type="string">5.7.2</property>
<property name="InitialAsyncDataFetch" type="bool">False</property>
<property name="AutoRefreshInterval" type="int">60</property>
<property name="Filter3IsCustomValue" type="bool">False</property>
<property name="GroupStyle" type="string">Band</property>
<property name="AllowZoneChange" type="bool">True</property>
<property name="FilterIncludeChildren3" type="bool">False</property>
<property name="EnableOriginalValue" type="bool">False</property>
<property name="ItemLimit" type="int">3</property>
<property name="FilterType1" type="string">Choice</property>
<property name="UseCopyUtil" type="bool">True</property>
<property name="FilterType3" type="string" />
<property name="FilterType2" type="string">Choice</property>
<property name="FilterOperator2" type="Microsoft.SharePoint.Publishing.WebControls.ContentByQueryWebPart+FilterFieldQueryOperator, Microsoft.SharePoint.Publishing, Version=15.0.0.0, Culture=neutral,
PublicKeyToken=71e9bce111e9429c">Eq</property>
<property name="PageType" type="Microsoft.SharePoint.PAGETYPE, Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c">PAGE_NORMALVIEW</property>
<property name="FilterByAudience" type="bool">False</property>
<property name="ItemXslLink" type="string" />
<property name="Hidden" type="bool">False</property>
<property name="WebUrl" type="string">~sitecollection/ProductDevelopment/HCMPayroll/HRMSproject572</property>
<property name="HeaderXslLink" type="string" />
<property name="CacheXslStorage" type="bool">True</property>
<property name="ListsOverride" type="string" />
<property name="SortByDirection" type="Microsoft.SharePoint.Publishing.WebControls.ContentByQueryWebPart+SortDirection, Microsoft.SharePoint.Publishing, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c">Asc</property>
<property name="Filter2IsCustomValue" type="bool">False</property>
<property name="AllowEdit" type="bool">True</property>
<property name="FeedTitle" type="string" />
<property name="FilterField3" type="string" />
<property name="MediaPlayerStyleSource" type="string" null="true" />
<property name="DisplayColumns" type="int">2</property>
<property name="Filter2ChainingOperator" type="Microsoft.SharePoint.Publishing.WebControls.ContentByQueryWebPart+FilterChainingOperator, Microsoft.SharePoint.Publishing, Version=15.0.0.0, Culture=neutral,
PublicKeyToken=71e9bce111e9429c">And</property>
<property name="XmlDefinition" type="string" />
<property name="WebsOverride" type="string" />
<property name="AllowClose" type="bool">True</property>
<property name="ContentTypeName" type="string" />
<property name="ListId" type="System.Guid, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">00000000-0000-0000-0000-000000000000</property>
<property name="ExportMode" type="exportmode">All</property>
<property name="NoDefaultStyle" type="string" null="true" />
<property name="ViewFieldsOverride" type="string" />
<property name="CatalogIconImageUrl" type="string" />
<property name="ListDisplayName" type="string" null="true" />
<property name="Width" type="string" />
</properties>
</data>
</webPart>
</webParts><label for="ctl00_MSOTlPn_EditorZone_Edit0g_789619b5_3406_469e_8b24_fc42ff130ea0_CBQToolPartshowItemsFromListRadioButton"></label>
This is with missing columns values
<webParts>
<webPart xmlns="http://schemas.microsoft.com/WebPart/v3">
<metaData>
<type name="Microsoft.SharePoint.Publishing.WebControls.ContentByQueryWebPart, Microsoft.SharePoint.Publishing, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
<importErrorMessage>Cannot import this Web Part.</importErrorMessage>
</metaData>
<data>
<properties>
<property name="Filter1ChainingOperator" type="Microsoft.SharePoint.Publishing.WebControls.ContentByQueryWebPart+FilterChainingOperator, Microsoft.SharePoint.Publishing, Version=15.0.0.0, Culture=neutral,
PublicKeyToken=71e9bce111e9429c">And</property>
<property name="FilterOperator1" type="Microsoft.SharePoint.Publishing.WebControls.ContentByQueryWebPart+FilterFieldQueryOperator, Microsoft.SharePoint.Publishing, Version=15.0.0.0, Culture=neutral,
PublicKeyToken=71e9bce111e9429c">Eq</property>
<property name="Direction" type="direction">NotSet</property>
<property name="FilterOperator3" type="Microsoft.SharePoint.Publishing.WebControls.ContentByQueryWebPart+FilterFieldQueryOperator, Microsoft.SharePoint.Publishing, Version=15.0.0.0, Culture=neutral,
PublicKeyToken=71e9bce111e9429c">Eq</property>
<property name="GroupByDirection" type="Microsoft.SharePoint.Publishing.WebControls.ContentByQueryWebPart+SortDirection, Microsoft.SharePoint.Publishing, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c">Asc</property>
<property name="DataSourceID" type="string" />
<property name="ChromeState" type="chromestate">Normal</property>
<property name="SystemViewFields" type="string" />
<property name="ListName" type="string" />
<property name="FilterDisplayValue3" type="string" />
<property name="FilterDisplayValue2" type="string">5.7.2</property>
<property name="FilterDisplayValue1" type="string">HCM/Payroll</property>
<property name="FilterField1" type="string">{a10809c0-a375-4279-ade5-2603dbdcd7e9}</property>
<property name="Description" type="string">Use to display a dynamic view of content from your site on a web page</property>
<property name="DataColumnRenames" type="string" />
<property name="MissingAssembly" type="string">Cannot import this Web Part.</property>
<property name="PageSize" type="int">-1</property>
<property name="ViewContentTypeId" type="string" />
<property name="ParameterBindings" type="string" null="true" />
<property name="HelpUrl" type="string" />
<property name="AdditionalFilterFields" type="string" />
<property name="DataMappingViewFields" type="string">{fa564e0f-0c70-4ab9-b863-0177e6ddd247},Text;</property>
<property name="Title" type="string">Prod 1 Lib CQWP</property>
<property name="FeedDescription" type="string" />
<property name="UseCache" type="bool">True</property>
<property name="XslLink" type="string" null="true" />
<property name="AutoRefresh" type="bool">False</property>
<property name="Filter1IsCustomValue" type="bool">False</property>
<property name="FireInitialRow" type="bool">True</property>
<property name="FilterValue3" type="string" />
<property name="SortByFieldType" type="string">DateTime</property>
<property name="ManualRefresh" type="bool">False</property>
<property name="HelpMode" type="helpmode">Modeless</property>
<property name="AllowConnect" type="bool">True</property>
<property name="ItemStyle" type="string">RDDesignDocuments</property>
<property name="SampleData" type="string"><dsQueryResponse>
<Rows>
<Row Title="Item 1" LinkUrl="http://Item1" Group="Group Header" __begincolumn="True"
__begingroup="True" />
<Row Title="Item 2" LinkUrl="http://Item2" __begincolumn="False" __begingroup="False"
/>
<Row Title="Item 3" LinkUrl="http://Item3" __begincolumn="False" __begingroup="False"
/>
</Rows>
</dsQueryResponse></property>
<property name="FilterIncludeChildren2" type="bool">False</property>
<property name="XmlDefinitionLink" type="string" />
<property name="ServerTemplate" type="string">101</property>
<property name="TitleUrl" type="string" />
<property name="CommonViewFields" type="string">Title,Text;Product_x0020_Name,Choice;Areabranch,Choice;ProdcutDesignDocCategory,Choice;User_x0020_Story,Text;Status,Choice</property>
<property name="QueryOverride" type="string" />
<property name="DataSourcesString" type="string" />
<property name="DisplayName" type="string" />
<property name="ListGuid" type="string" />
<property name="DataFields" type="string" />
<property name="ShowWithSampleData" type="bool">False</property>
<property name="GroupByFieldType" type="string">Text</property>
<property name="Default" type="string" />
<property name="ViewFlags" type="Microsoft.SharePoint.SPViewFlags, Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c">None</property>
<property name="ContentTypeBeginsWithId" type="string">0x010100634C5EFE866C834E92467F3F8D9C37C7080401</property>
<property name="AllowHide" type="bool">True</property>
<property name="FeedEnabled" type="bool">False</property>
<property name="SortBy" type="string">{28cf69c5-fa48-462a-b5cd-27b6f9d2bd5f}</property>
<property name="FilterByContextTerm" type="bool">False</property>
<property name="TitleIconImageUrl" type="string" />
<property name="PlayMediaInBrowser" type="bool">True</property>
<property name="ViewFlag" type="string">0</property>
<property name="Xsl" type="string"><xsl:stylesheet xmlns:x="http://www.w3.org/2001/XMLSchema" version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:cmswrt="http://schemas.microsoft.com/WebPart/v3/Publishing/runtime" exclude-result-prefixes="xsl cmswrt x" > <xsl:import href="/Style Library/XSL Style Sheets/Header.xsl" /> <xsl:import href="/Style
Library/XSL Style Sheets/ItemStyle.xsl" /> <xsl:import href="/Style Library/XSL Style Sheets/ContentQueryMain.xsl" /> </xsl:stylesheet></property>
<property name="FilterField2" type="string">{d51bf689-5b9f-454b-9d6a-4e2c375ec3fe}</property>
<property name="ChromeType" type="chrometype">TitleOnly</property>
<property name="CacheXslTimeOut" type="int">86400</property>
<property name="AdditionalGroupAndSortFields" type="string" />
<property name="UseSQLDataSourcePaging" type="bool">True</property>
<property name="Height" type="string" />
<property name="DataMappings" type="string">User_x005F_x0020_Story:|LinkUrl:|Description:|OpenInNewWindow:|Product_x005F_x0020_Name:|Areabranch:|ImageUrl:|Title:{fa564e0f-0c70-4ab9-b863-0177e6ddd247},Title,Text;|LinkToolTip:|ProdcutDesignDocCategory:|Status:|SipAddress:|</property>
<property name="ListUrl" type="string" null="true" />
<property name="ShowUntargetedItems" type="bool">False</property>
<property name="AllowMinimize" type="bool">True</property>
<property name="GroupBy" type="string">{5c67db99-375a-4afa-a1b0-16f2aac40bb8}</property>
<property name="FilterIncludeChildren1" type="bool">False</property>
<property name="BaseType" type="string" />
<property name="MainXslLink" type="string" />
<property name="AsyncRefresh" type="bool">False</property>
<property name="FilterValue1" type="string">HCM/Payroll</property>
<property name="FilterValue2" type="string">5.7.2</property>
<property name="InitialAsyncDataFetch" type="bool">False</property>
<property name="AutoRefreshInterval" type="int">60</property>
<property name="Filter3IsCustomValue" type="bool">False</property>
<property name="GroupStyle" type="string">Band</property>
<property name="AllowZoneChange" type="bool">True</property>
<property name="FilterIncludeChildren3" type="bool">False</property>
<property name="EnableOriginalValue" type="bool">False</property>
<property name="ItemLimit" type="int">3</property>
<property name="FilterType1" type="string">Text</property>
<property name="UseCopyUtil" type="bool">True</property>
<property name="FilterType3" type="string" />
<property name="FilterType2" type="string">Text</property>
<property name="FilterOperator2" type="Microsoft.SharePoint.Publishing.WebControls.ContentByQueryWebPart+FilterFieldQueryOperator, Microsoft.SharePoint.Publishing, Version=15.0.0.0, Culture=neutral,
PublicKeyToken=71e9bce111e9429c">Eq</property>
<property name="PageType" type="Microsoft.SharePoint.PAGETYPE, Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c">PAGE_NORMALVIEW</property>
<property name="FilterByAudience" type="bool">False</property>
<property name="ItemXslLink" type="string" />
<property name="Hidden" type="bool">False</property>
<property name="WebUrl" type="string" />
<property name="HeaderXslLink" type="string" />
<property name="CacheXslStorage" type="bool">True</property>
<property name="ListsOverride" type="string" />
<property name="SortByDirection" type="Microsoft.SharePoint.Publishing.WebControls.ContentByQueryWebPart+SortDirection, Microsoft.SharePoint.Publishing, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c">Asc</property>
<property name="Filter2IsCustomValue" type="bool">False</property>
<property name="AllowEdit" type="bool">True</property>
<property name="FeedTitle" type="string" />
<property name="FilterField3" type="string" />
<property name="MediaPlayerStyleSource" type="string" null="true" />
<property name="DisplayColumns" type="int">2</property>
<property name="Filter2ChainingOperator" type="Microsoft.SharePoint.Publishing.WebControls.ContentByQueryWebPart+FilterChainingOperator, Microsoft.SharePoint.Publishing, Version=15.0.0.0, Culture=neutral,
PublicKeyToken=71e9bce111e9429c">Or</property>
<property name="XmlDefinition" type="string" />
<property name="WebsOverride" type="string" />
<property name="AllowClose" type="bool">True</property>
<property name="ContentTypeName" type="string" />
<property name="ListId" type="System.Guid, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">00000000-0000-0000-0000-000000000000</property>
<property name="ExportMode" type="exportmode">All</property>
<property name="NoDefaultStyle" type="string" null="true" />
<property name="ViewFieldsOverride" type="string" />
<property name="CatalogIconImageUrl" type="string" />
<property name="ListDisplayName" type="string" null="true" />
<property name="Width" type="string" />
</properties>
</data>
</webPart>
</webParts>
<label for="ctl00_MSOTlPn_EditorZone_Edit0g_789619b5_3406_469e_8b24_fc42ff130ea0_CBQToolPartshowItemsFromListRadioButton"></label>
<label for="ctl00_MSOTlPn_EditorZone_Edit0g_789619b5_3406_469e_8b24_fc42ff130ea0_CBQToolPartshowItemsFromListRadioButton"></label>Hi,
may i know how many items that you have that CQWP filter for?
because as i remember there should be a limitation on the items number.
http://technet.microsoft.com/en-us/library/cc262813(v=office.14).aspx
http://office.microsoft.com/en-us/sharepoint-foundation-help/manage-lists-and-libraries-with-many-items-HA010377496.aspx
you can try to upsize the threshold but it will affect your environment's performance.
http://blogs.msdn.com/b/dinaayoub/archive/2010/04/22/sharepoint-2010-how-to-change-the-list-view-threshold.aspx
Regards,
Aries
Microsoft Online Community Support
Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. -
Top N Analysis with multiple columns
Hi
I am using Oracle 9i. I do have a table which contains datewise promotional material types for an organisation.
The structure is as follows:
CREATE TABLE TEST
(CDATE DATE,
BROCHURE VARCHAR2(1),
WEBSITE VARCHAR2(1),
DIRECT_MAIL VARCHAR2(1),
PRESS_RELEASE VARCHAR2(1),
JOURNAL_AD VARCHAR2(1)
and the sample data is as follows:
CDate Brochure Website Direct_Mail Press_Release Journal_Ad
01/04/1996 Y Y Y N N
02/04/1996 Y Y N N N
23/06/1996 Y N Y Y N
13/09/1996 Y Y N N N
01/04/1997 Y Y N N N
02/04/1997 Y Y Y N Y
23/06/1997 N Y N N Y
13/09/1997 Y Y N N N
01/04/1998 Y Y Y N N
02/04/1998 Y N N Y N
23/06/1998 N Y N N Y
13/09/1998 Y Y N N Y
01/04/1999 Y Y Y N Y
02/04/1999 Y N N Y N
23/06/1999 N Y N N N
13/09/1999 Y Y Y N N
I want to have year wise top 4 promotional types in terms of count of 'Y' only. The result should be like as follows:
YEAR:1996
TYPE COUNT
BROCHURE 4
WEBSITE 3
DIRECT_MAIL 2
PRESS_RELEASE 1
JOURNAL_AD 0
YEAR:1997
TYPE COUNT
WEBSITE 4
BROCHURE 3
JOURNAL_AD 2
DIRECT_MAIL 1
PRESS_RELEASE 1
Please suggest a solution for the same. I am not able to sort it for multiple columns.
Regards
MSOne of the questions that must be asked when you have a requirement to only show the top N ranked items in a list, is "what about a tie in the ranking?".
Oracle has two ranking functions that allow you to deal with either requirement - RANK and DENSE_RANK. Both operate as either analytic or aggregate functions, so either will work for your requirements. The previous posting by Miguel demonstrated how to decode your Y/N flags and pivot the data.
In this example, I've taken the liberty of adding some data to year 2000 that will show the difference between RANK and DENSE_RANK as well as how to use them to filter your results.
First, here's the decoded/pivoted data:
SQL>WITH test AS
2 ( SELECT TO_DATE('01/04/1996','dd/mm/yyyy') AS CDATE, 'Y' AS BROCHURE, 'Y' AS WEBSITE, 'Y' AS DIRECT_MAIL, 'N' AS PRESS_RELEASE, 'N' AS JOURNAL_AD FROM DUAL
3 UNION ALL SELECT TO_DATE('02/04/1996','dd/mm/yyyy') AS CDATE, 'Y' AS BROCHURE, 'Y' AS WEBSITE, 'N' AS DIRECT_MAIL, 'N' AS PRESS_RELEASE, 'N' AS JOURNAL_AD FROM DUAL
4 UNION ALL SELECT TO_DATE('23/06/1996','dd/mm/yyyy') AS CDATE, 'Y' AS BROCHURE, 'N' AS WEBSITE, 'Y' AS DIRECT_MAIL, 'Y' AS PRESS_RELEASE, 'N' AS JOURNAL_AD FROM DUAL
5 UNION ALL SELECT TO_DATE('13/09/1996','dd/mm/yyyy') AS CDATE, 'Y' AS BROCHURE, 'Y' AS WEBSITE, 'N' AS DIRECT_MAIL, 'N' AS PRESS_RELEASE, 'N' AS JOURNAL_AD FROM DUAL
6 UNION ALL SELECT TO_DATE('01/04/1997','dd/mm/yyyy') AS CDATE, 'Y' AS BROCHURE, 'Y' AS WEBSITE, 'N' AS DIRECT_MAIL, 'N' AS PRESS_RELEASE, 'N' AS JOURNAL_AD FROM DUAL
7 UNION ALL SELECT TO_DATE('02/04/1997','dd/mm/yyyy') AS CDATE, 'Y' AS BROCHURE, 'Y' AS WEBSITE, 'Y' AS DIRECT_MAIL, 'N' AS PRESS_RELEASE, 'Y' AS JOURNAL_AD FROM DUAL
8 UNION ALL SELECT TO_DATE('23/06/1997','dd/mm/yyyy') AS CDATE, 'N' AS BROCHURE, 'Y' AS WEBSITE, 'N' AS DIRECT_MAIL, 'N' AS PRESS_RELEASE, 'Y' AS JOURNAL_AD FROM DUAL
9 UNION ALL SELECT TO_DATE('13/09/1997','dd/mm/yyyy') AS CDATE, 'Y' AS BROCHURE, 'Y' AS WEBSITE, 'N' AS DIRECT_MAIL, 'N' AS PRESS_RELEASE, 'N' AS JOURNAL_AD FROM DUAL
10 UNION ALL SELECT TO_DATE('01/04/1998','dd/mm/yyyy') AS CDATE, 'Y' AS BROCHURE, 'Y' AS WEBSITE, 'Y' AS DIRECT_MAIL, 'N' AS PRESS_RELEASE, 'N' AS JOURNAL_AD FROM DUAL
11 UNION ALL SELECT TO_DATE('02/04/1998','dd/mm/yyyy') AS CDATE, 'Y' AS BROCHURE, 'N' AS WEBSITE, 'N' AS DIRECT_MAIL, 'Y' AS PRESS_RELEASE, 'N' AS JOURNAL_AD FROM DUAL
12 UNION ALL SELECT TO_DATE('23/06/1998','dd/mm/yyyy') AS CDATE, 'N' AS BROCHURE, 'Y' AS WEBSITE, 'N' AS DIRECT_MAIL, 'N' AS PRESS_RELEASE, 'Y' AS JOURNAL_AD FROM DUAL
13 UNION ALL SELECT TO_DATE('13/09/1998','dd/mm/yyyy') AS CDATE, 'Y' AS BROCHURE, 'Y' AS WEBSITE, 'N' AS DIRECT_MAIL, 'N' AS PRESS_RELEASE, 'Y' AS JOURNAL_AD FROM DUAL
14 UNION ALL SELECT TO_DATE('01/04/1999','dd/mm/yyyy') AS CDATE, 'Y' AS BROCHURE, 'Y' AS WEBSITE, 'Y' AS DIRECT_MAIL, 'N' AS PRESS_RELEASE, 'Y' AS JOURNAL_AD FROM DUAL
15 UNION ALL SELECT TO_DATE('02/04/1999','dd/mm/yyyy') AS CDATE, 'Y' AS BROCHURE, 'N' AS WEBSITE, 'N' AS DIRECT_MAIL, 'Y' AS PRESS_RELEASE, 'N' AS JOURNAL_AD FROM DUAL
16 UNION ALL SELECT TO_DATE('23/06/1999','dd/mm/yyyy') AS CDATE, 'N' AS BROCHURE, 'Y' AS WEBSITE, 'N' AS DIRECT_MAIL, 'N' AS PRESS_RELEASE, 'N' AS JOURNAL_AD FROM DUAL
17 UNION ALL SELECT TO_DATE('13/09/1999','dd/mm/yyyy') AS CDATE, 'Y' AS BROCHURE, 'Y' AS WEBSITE, 'Y' AS DIRECT_MAIL, 'N' AS PRESS_RELEASE, 'N' AS JOURNAL_AD FROM DUAL
18 UNION ALL SELECT TO_DATE('01/04/2000','dd/mm/yyyy') AS CDATE, 'Y' AS BROCHURE, 'Y' AS WEBSITE, 'Y' AS DIRECT_MAIL, 'N' AS PRESS_RELEASE, 'Y' AS JOURNAL_AD FROM DUAL
19 UNION ALL SELECT TO_DATE('02/04/2000','dd/mm/yyyy') AS CDATE, 'Y' AS BROCHURE, 'Y' AS WEBSITE, 'Y' AS DIRECT_MAIL, 'Y' AS PRESS_RELEASE, 'N' AS JOURNAL_AD FROM DUAL
20 UNION ALL SELECT TO_DATE('23/06/2000','dd/mm/yyyy') AS CDATE, 'Y' AS BROCHURE, 'Y' AS WEBSITE, 'N' AS DIRECT_MAIL, 'N' AS PRESS_RELEASE, 'N' AS JOURNAL_AD FROM DUAL
21 UNION ALL SELECT TO_DATE('13/09/2000','dd/mm/yyyy') AS CDATE, 'Y' AS BROCHURE, 'Y' AS WEBSITE, 'Y' AS DIRECT_MAIL, 'Y' AS PRESS_RELEASE, 'N' AS JOURNAL_AD FROM DUAL
22 )
23 SELECT cyear
24 ,ctype
25 ,RANK() OVER (PARTITION BY cyear ORDER BY num_media DESC) ranking
26 ,DENSE_RANK() OVER (PARTITION BY cyear ORDER BY num_media DESC) dense_ranking
27 FROM (SELECT TRUNC(CDATE,'Y') CYEAR
28 ,'BROCHURE' CTYPE, SUM(DECODE(BROCHURE, 'Y', 1, 0)) NUM_MEDIA
29 FROM test
30 GROUP BY TRUNC(CDATE,'Y')
31 UNION ALL
32 SELECT TRUNC(CDATE,'Y') CYEAR
33 ,'WEBSITE' CTYPE, SUM(DECODE(WEBSITE, 'Y', 1, 0))
34 FROM test
35 GROUP BY TRUNC(CDATE,'Y')
36 UNION ALL
37 SELECT TRUNC(CDATE,'Y') CYEAR
38 ,'DIRECT_MAIL' CTYPE, SUM(DECODE(DIRECT_MAIL, 'Y', 1, 0))
39 FROM test
40 GROUP BY TRUNC(CDATE,'Y')
41 UNION ALL
42 SELECT TRUNC(CDATE,'Y') CYEAR
43 ,'PRESS_RELEASE' CTYPE, SUM(DECODE(PRESS_RELEASE, 'Y', 1, 0))
44 FROM test
45 GROUP BY TRUNC(CDATE,'Y')
46 UNION ALL
47 SELECT TRUNC(CDATE,'Y') CYEAR
48 ,'JOURNAL_AD' CTYPE, SUM(DECODE(JOURNAL_AD, 'Y', 1, 0))
49 FROM test
50 GROUP BY TRUNC(CDATE,'Y')
51 )
52* order by cyear desc, ranking
53 /
CYEAR CTYPE RANKING DENSE_RANKING
01-Jan-2000 00:00:00 BROCHURE 1 1
01-Jan-2000 00:00:00 WEBSITE 1 1
01-Jan-2000 00:00:00 DIRECT_MAIL 3 2
01-Jan-2000 00:00:00 PRESS_RELEASE 4 3
01-Jan-2000 00:00:00 JOURNAL_AD 5 4
01-Jan-1999 00:00:00 BROCHURE 1 1
01-Jan-1999 00:00:00 WEBSITE 1 1
01-Jan-1999 00:00:00 DIRECT_MAIL 3 2
01-Jan-1999 00:00:00 PRESS_RELEASE 4 3
01-Jan-1999 00:00:00 JOURNAL_AD 4 3
01-Jan-1998 00:00:00 BROCHURE 1 1
01-Jan-1998 00:00:00 WEBSITE 1 1
01-Jan-1998 00:00:00 JOURNAL_AD 3 2
01-Jan-1998 00:00:00 DIRECT_MAIL 4 3
01-Jan-1998 00:00:00 PRESS_RELEASE 4 3
01-Jan-1997 00:00:00 WEBSITE 1 1
01-Jan-1997 00:00:00 BROCHURE 2 2
01-Jan-1997 00:00:00 JOURNAL_AD 3 3
01-Jan-1997 00:00:00 DIRECT_MAIL 4 4
01-Jan-1997 00:00:00 PRESS_RELEASE 5 5
01-Jan-1996 00:00:00 BROCHURE 1 1
01-Jan-1996 00:00:00 WEBSITE 2 2
01-Jan-1996 00:00:00 DIRECT_MAIL 3 3
01-Jan-1996 00:00:00 PRESS_RELEASE 4 4
01-Jan-1996 00:00:00 JOURNAL_AD 5 5You can see that in year 2000 there is a tie for first place (ranking #1). The RANK function will name the second highest count 3 (skipping the rank of 2 due to the tie), while the DENSE_RANK function will not skip a ranking.
Now, to filter on the ranking, wrap your query in another in-line view like this - but use which ever ranking function YOUR requirements call for:
SQL>WITH test AS
2 ( SELECT TO_DATE('01/04/1996','dd/mm/yyyy') AS CDATE, 'Y' AS BROCHURE, 'Y' AS WEBSITE, 'Y' AS DIRECT_MAIL, 'N' AS PRESS_RELEASE, 'N' AS JOURNAL_AD FROM DUAL
3 UNION ALL SELECT TO_DATE('02/04/1996','dd/mm/yyyy') AS CDATE, 'Y' AS BROCHURE, 'Y' AS WEBSITE, 'N' AS DIRECT_MAIL, 'N' AS PRESS_RELEASE, 'N' AS JOURNAL_AD FROM DUAL
4 UNION ALL SELECT TO_DATE('23/06/1996','dd/mm/yyyy') AS CDATE, 'Y' AS BROCHURE, 'N' AS WEBSITE, 'Y' AS DIRECT_MAIL, 'Y' AS PRESS_RELEASE, 'N' AS JOURNAL_AD FROM DUAL
5 UNION ALL SELECT TO_DATE('13/09/1996','dd/mm/yyyy') AS CDATE, 'Y' AS BROCHURE, 'Y' AS WEBSITE, 'N' AS DIRECT_MAIL, 'N' AS PRESS_RELEASE, 'N' AS JOURNAL_AD FROM DUAL
6 UNION ALL SELECT TO_DATE('01/04/1997','dd/mm/yyyy') AS CDATE, 'Y' AS BROCHURE, 'Y' AS WEBSITE, 'N' AS DIRECT_MAIL, 'N' AS PRESS_RELEASE, 'N' AS JOURNAL_AD FROM DUAL
7 UNION ALL SELECT TO_DATE('02/04/1997','dd/mm/yyyy') AS CDATE, 'Y' AS BROCHURE, 'Y' AS WEBSITE, 'Y' AS DIRECT_MAIL, 'N' AS PRESS_RELEASE, 'Y' AS JOURNAL_AD FROM DUAL
8 UNION ALL SELECT TO_DATE('23/06/1997','dd/mm/yyyy') AS CDATE, 'N' AS BROCHURE, 'Y' AS WEBSITE, 'N' AS DIRECT_MAIL, 'N' AS PRESS_RELEASE, 'Y' AS JOURNAL_AD FROM DUAL
9 UNION ALL SELECT TO_DATE('13/09/1997','dd/mm/yyyy') AS CDATE, 'Y' AS BROCHURE, 'Y' AS WEBSITE, 'N' AS DIRECT_MAIL, 'N' AS PRESS_RELEASE, 'N' AS JOURNAL_AD FROM DUAL
10 UNION ALL SELECT TO_DATE('01/04/1998','dd/mm/yyyy') AS CDATE, 'Y' AS BROCHURE, 'Y' AS WEBSITE, 'Y' AS DIRECT_MAIL, 'N' AS PRESS_RELEASE, 'N' AS JOURNAL_AD FROM DUAL
11 UNION ALL SELECT TO_DATE('02/04/1998','dd/mm/yyyy') AS CDATE, 'Y' AS BROCHURE, 'N' AS WEBSITE, 'N' AS DIRECT_MAIL, 'Y' AS PRESS_RELEASE, 'N' AS JOURNAL_AD FROM DUAL
12 UNION ALL SELECT TO_DATE('23/06/1998','dd/mm/yyyy') AS CDATE, 'N' AS BROCHURE, 'Y' AS WEBSITE, 'N' AS DIRECT_MAIL, 'N' AS PRESS_RELEASE, 'Y' AS JOURNAL_AD FROM DUAL
13 UNION ALL SELECT TO_DATE('13/09/1998','dd/mm/yyyy') AS CDATE, 'Y' AS BROCHURE, 'Y' AS WEBSITE, 'N' AS DIRECT_MAIL, 'N' AS PRESS_RELEASE, 'Y' AS JOURNAL_AD FROM DUAL
14 UNION ALL SELECT TO_DATE('01/04/1999','dd/mm/yyyy') AS CDATE, 'Y' AS BROCHURE, 'Y' AS WEBSITE, 'Y' AS DIRECT_MAIL, 'N' AS PRESS_RELEASE, 'Y' AS JOURNAL_AD FROM DUAL
15 UNION ALL SELECT TO_DATE('02/04/1999','dd/mm/yyyy') AS CDATE, 'Y' AS BROCHURE, 'N' AS WEBSITE, 'N' AS DIRECT_MAIL, 'Y' AS PRESS_RELEASE, 'N' AS JOURNAL_AD FROM DUAL
16 UNION ALL SELECT TO_DATE('23/06/1999','dd/mm/yyyy') AS CDATE, 'N' AS BROCHURE, 'Y' AS WEBSITE, 'N' AS DIRECT_MAIL, 'N' AS PRESS_RELEASE, 'N' AS JOURNAL_AD FROM DUAL
17 UNION ALL SELECT TO_DATE('13/09/1999','dd/mm/yyyy') AS CDATE, 'Y' AS BROCHURE, 'Y' AS WEBSITE, 'Y' AS DIRECT_MAIL, 'N' AS PRESS_RELEASE, 'N' AS JOURNAL_AD FROM DUAL
18 UNION ALL SELECT TO_DATE('01/04/2000','dd/mm/yyyy') AS CDATE, 'Y' AS BROCHURE, 'Y' AS WEBSITE, 'Y' AS DIRECT_MAIL, 'N' AS PRESS_RELEASE, 'Y' AS JOURNAL_AD FROM DUAL
19 UNION ALL SELECT TO_DATE('02/04/2000','dd/mm/yyyy') AS CDATE, 'Y' AS BROCHURE, 'Y' AS WEBSITE, 'Y' AS DIRECT_MAIL, 'Y' AS PRESS_RELEASE, 'N' AS JOURNAL_AD FROM DUAL
20 UNION ALL SELECT TO_DATE('23/06/2000','dd/mm/yyyy') AS CDATE, 'Y' AS BROCHURE, 'Y' AS WEBSITE, 'N' AS DIRECT_MAIL, 'N' AS PRESS_RELEASE, 'N' AS JOURNAL_AD FROM DUAL
21 UNION ALL SELECT TO_DATE('13/09/2000','dd/mm/yyyy') AS CDATE, 'Y' AS BROCHURE, 'Y' AS WEBSITE, 'Y' AS DIRECT_MAIL, 'Y' AS PRESS_RELEASE, 'N' AS JOURNAL_AD FROM DUAL
22 )
23 SELECT * FROM (
24 SELECT cyear
25 ,ctype
26 ,RANK() OVER (PARTITION BY cyear ORDER BY num_media DESC) ranking
27 ,DENSE_RANK() OVER (PARTITION BY cyear ORDER BY num_media DESC) dense_ranking
28 FROM (SELECT TRUNC(CDATE,'Y') CYEAR
29 ,'BROCHURE' CTYPE, SUM(DECODE(BROCHURE, 'Y', 1, 0)) NUM_MEDIA
30 FROM test
31 GROUP BY TRUNC(CDATE,'Y')
32 UNION ALL
33 SELECT TRUNC(CDATE,'Y') CYEAR
34 ,'WEBSITE' CTYPE, SUM(DECODE(WEBSITE, 'Y', 1, 0))
35 FROM test
36 GROUP BY TRUNC(CDATE,'Y')
37 UNION ALL
38 SELECT TRUNC(CDATE,'Y') CYEAR
39 ,'DIRECT_MAIL' CTYPE, SUM(DECODE(DIRECT_MAIL, 'Y', 1, 0))
40 FROM test
41 GROUP BY TRUNC(CDATE,'Y')
42 UNION ALL
43 SELECT TRUNC(CDATE,'Y') CYEAR
44 ,'PRESS_RELEASE' CTYPE, SUM(DECODE(PRESS_RELEASE, 'Y', 1, 0))
45 FROM test
46 GROUP BY TRUNC(CDATE,'Y')
47 UNION ALL
48 SELECT TRUNC(CDATE,'Y') CYEAR
49 ,'JOURNAL_AD' CTYPE, SUM(DECODE(JOURNAL_AD, 'Y', 1, 0))
50 FROM test
51 GROUP BY TRUNC(CDATE,'Y')
52 )
53 )
54 where RANKING <= 4
55* order by cyear desc, ranking
56 /
CYEAR CTYPE RANKING DENSE_RANKING
01-Jan-2000 00:00:00 WEBSITE 1 1
01-Jan-2000 00:00:00 BROCHURE 1 1
01-Jan-2000 00:00:00 DIRECT_MAIL 3 2
01-Jan-2000 00:00:00 PRESS_RELEASE 4 3
01-Jan-1999 00:00:00 BROCHURE 1 1
01-Jan-1999 00:00:00 WEBSITE 1 1
01-Jan-1999 00:00:00 DIRECT_MAIL 3 2
01-Jan-1999 00:00:00 JOURNAL_AD 4 3
01-Jan-1999 00:00:00 PRESS_RELEASE 4 3
01-Jan-1998 00:00:00 BROCHURE 1 1
01-Jan-1998 00:00:00 WEBSITE 1 1
01-Jan-1998 00:00:00 JOURNAL_AD 3 2
01-Jan-1998 00:00:00 PRESS_RELEASE 4 3
01-Jan-1998 00:00:00 DIRECT_MAIL 4 3
01-Jan-1997 00:00:00 WEBSITE 1 1
01-Jan-1997 00:00:00 BROCHURE 2 2
01-Jan-1997 00:00:00 JOURNAL_AD 3 3
01-Jan-1997 00:00:00 DIRECT_MAIL 4 4
01-Jan-1996 00:00:00 BROCHURE 1 1
01-Jan-1996 00:00:00 WEBSITE 2 2
01-Jan-1996 00:00:00 DIRECT_MAIL 3 3
01-Jan-1996 00:00:00 PRESS_RELEASE 4 4 -
Multiple columns and rows in MessageService
I am attempting to create a message (via MessageService) which has multiple lines of data, and each line has multiple data columns.
Background: My program reads data from a web store, and creates Sales Orders in SBO. A single run might process multiple orders. When all orders have been entered, the program should send a (single) message to a list of recipients. The message will have one line of data for each sales order produced. Each line will contain two fields: the linked SBO sales order number, and the unlinked web order number.
When the message is initially created, I'm defining the multiple columns and initializing the data lines:
pMessageDataColumns = oMessage.MessageDataColumns
pMessageDataColumn = pMessageDataColumns.Add()
pMessageDataColumn.ColumnName = "SalesOrder"
pMessageDataColumn.Link = BoYesNoEnum.tYES
pMessageDataColumn = pMessageDataColumns.Add()
pMessageDataColumn.ColumnName = "WebOrder"
pMessageDataColumn.Link = BoYesNoEnum.tNO
oLines = pMessageDataColumn.MessageDataLines()
Later, as each Sales Order is processed, I'm attempting to inject the two data values into the message data:
oLine = oLines.Add()
oLine.Value = Str(pOrd.DocNum)
oLine.Object = 17
oLine.ObjectKey = Str(pOrd.DocEntry)
oLine = oLines.Add()
oLine.Value = pOrd.WebOrder
The above code would be invoked for each Sales Order processed. However, it generates an "Internal error (-5002) occurred" when the message is ultimately sent.
The SDK documentation states:
The MessageDataLine is a child data structure related to the MessageDataColumn. It contains the value of a specified cell in the Data table, which is defined by its column number (vtIndex of Item of MessageDataColumns) and row number (vtIndex of Item of MessageDataLines).
I guess I don't understand the relationship between adding a "line" in my data display versus adding data into a "column". It appears that the "oLines.Add()" is used to bump across the columns of the data. If so, how do I advance to the next entire row of data in the message?
Thanks, DaveClass Item
Public ItemCode As String
Public Dscription As String
End Class
Dim ItemCodes as new list( of item)
Dim one as new item
one.ItemCode = "ItemCode"
one. Dscription ="Name of Item"
itemcodes.add (one)
Try
Dim oCmpSvc As SAPbobsCOM.CompanyService = _ocmp.GetCompanyService()
Dim oMsgSvc As SAPbobsCOM.MessagesService = oCmpSvc.GetBusinessService(ServiceTypes.MessagesService)
Dim oMsg As SAPbobsCOM.Message = oMsgSvc.GetDataInterface(MessagesServiceDataInterfaces.msdiMessage)
oMsg.Subject = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")
oMsg.Text = Msg
Dim oMsgDataColumn As SAPbobsCOM.MessageDataColumn
If ItemCodes.Count > 0 Then
oMsgDataColumn = oMsg.MessageDataColumns.Add()
oMsgDataColumn.ColumnName = "Product / Item Code"
oMsgDataColumn.Link = BoYesNoEnum.tYES
For Each oneitem As Item In ItemCodes
Dim oMsgDataLine As SAPbobsCOM.MessageDataLine = oMsgDataColumn.MessageDataLines.Add()
oMsgDataLine.Object = "4"
oMsgDataLine.ObjectKey = oneitem.ItemCode
oMsgDataLine.Value = oneitem.Dscription
Next
oMsgDataColumn = oMsg.MessageDataColumns.Add()
oMsgDataColumn.ColumnName = "Description"
oMsgDataColumn.Link = BoYesNoEnum.tNO
For Each oneitem As Item In ItemCodes
Dim oMsgDataLine As SAPbobsCOM.MessageDataLine = oMsgDataColumn.MessageDataLines.Add()
oMsgDataLine.Value = oneitem.Dscription
Next
End If
Dim oMsgRecipient As SAPbobsCOM.Recipient = oMsg.RecipientCollection.Add()
oMsgRecipient.UserCode = "manager"
oMsgRecipient.SendInternal = BoYesNoEnum.tYES
oMsgRecipient.SendEmail = BoYesNoEnum.tNO
oMsgSvc.SendMessage(oMsg)
MsgBox("SAP B1 internal Message sent...")
Catch ex As Exception
MsgBox("Unable to send SAP B1 internal message. Error:" + ex.Message)
End Try
End Sub -
What is the point in having multiple columns in ORDER BY clause?
DB version:10gR2
When using ORDER BY clause, the rows are always sorted according to the first column in the ORDER BY clause. So, what is point in having multiple columns in the ORDER BY clause(i always see this in production codes)?
For the below SQLs' from SCOTT schema, the result sets are always ordered according the first column ename. When i added job asc and job desc, the result set doesn't change.
SQL> select * from emp order by ename;
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
7876 ADAMS CLERK 7788 23-MAY-87 1100 20
7499 ALLEN SALESMAN 7698 20-FEB-81 1600 300 30
7698 BLAKE MANAGER 7839 01-MAY-81 2850 30
7782 CLARK MANAGER 7839 09-JUN-81 2450 20
7902 FORD ANALYST 7566 03-DEC-81 3000 20
7900 JAMES CLERK 7698 03-DEC-81 950 30
7566 JONES MANAGER 7839 02-APR-81 2975 20
7839 KING PRESIDENT 17-NOV-81 5000 20
7654 MARTIN SALESMAN 7698 28-SEP-81 1250 1400 30
7934 MILLER CLERK 7782 23-JAN-82 1300 20
7788 SCOTT ANALYST 7566 19-APR-87 3000 20
7369 SMITH CLERK 7902 17-DEC-80 800 20
7844 TURNER SALESMAN 7698 08-SEP-81 1500 0 30
7521 WARD SALESMAN 7698 22-FEB-81 1250 500 30
14 rows selected.
SQL> select * from emp order by ename, job;
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
7876 ADAMS CLERK 7788 23-MAY-87 1100 20
7499 ALLEN SALESMAN 7698 20-FEB-81 1600 300 30
7698 BLAKE MANAGER 7839 01-MAY-81 2850 30
7782 CLARK MANAGER 7839 09-JUN-81 2450 20
7902 FORD ANALYST 7566 03-DEC-81 3000 20
7900 JAMES CLERK 7698 03-DEC-81 950 30
7566 JONES MANAGER 7839 02-APR-81 2975 20
7839 KING PRESIDENT 17-NOV-81 5000 20
7654 MARTIN SALESMAN 7698 28-SEP-81 1250 1400 30
7934 MILLER CLERK 7782 23-JAN-82 1300 20
7788 SCOTT ANALYST 7566 19-APR-87 3000 20
7369 SMITH CLERK 7902 17-DEC-80 800 20
7844 TURNER SALESMAN 7698 08-SEP-81 1500 0 30
7521 WARD SALESMAN 7698 22-FEB-81 1250 500 30
14 rows selected.
SQL> select * from emp order by ename, job desc;
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
7876 ADAMS CLERK 7788 23-MAY-87 1100 20
7499 ALLEN SALESMAN 7698 20-FEB-81 1600 300 30
7698 BLAKE MANAGER 7839 01-MAY-81 2850 30
7782 CLARK MANAGER 7839 09-JUN-81 2450 20
7902 FORD ANALYST 7566 03-DEC-81 3000 20
7900 JAMES CLERK 7698 03-DEC-81 950 30
7566 JONES MANAGER 7839 02-APR-81 2975 20
7839 KING PRESIDENT 17-NOV-81 5000 20
7654 MARTIN SALESMAN 7698 28-SEP-81 1250 1400 30
7934 MILLER CLERK 7782 23-JAN-82 1300 20
7788 SCOTT ANALYST 7566 19-APR-87 3000 20
7369 SMITH CLERK 7902 17-DEC-80 800 20
7844 TURNER SALESMAN 7698 08-SEP-81 1500 0 30
7521 WARD SALESMAN 7698 22-FEB-81 1250 500 30
14 rows selected.Because there is only one employee with the name SCOTT,FORD ...etc in the emp table and your first column in the order by list is ename
you spot the difference now
SQL> select * from emp order by job;
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
7788 SCOTT ANALYST 7566 19-APR-87 00:00:00 3000 20
7902 FORD ANALYST 7566 03-DEC-81 00:00:00 3000 20
7934 MILLER CLERK 7782 23-JAN-82 00:00:00 1300 10
7900 JAMES CLERK 7698 03-DEC-81 00:00:00 950 30
7369 SMITH CLERK 7902 17-DEC-80 00:00:00 800 20
7876 ADAMS CLERK 7788 23-MAY-87 00:00:00 1100 20
7698 BLAKE MANAGER 7839 01-MAY-81 00:00:00 2850 30
7566 JONES MANAGER 7839 02-APR-81 00:00:00 2975 20
7782 CLARK MANAGER 7839 09-JUN-81 00:00:00 2450 10
7839 KING PRESIDENT 17-NOV-81 00:00:00 5000 10
7844 TURNER SALESMAN 7698 08-SEP-81 00:00:00 1500 0 30
7654 MARTIN SALESMAN 7698 28-SEP-81 00:00:00 1250 1400 30
7521 WARD SALESMAN 7698 22-FEB-81 00:00:00 1250 500 30
7499 ALLEN SALESMAN 7698 20-FEB-81 00:00:00 1600 300 30
14 rows selected.
Elapsed: 00:00:00.00
SQL> select * from emp order by job, deptno asc;
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
7902 FORD ANALYST 7566 03-DEC-81 00:00:00 3000 20
7788 SCOTT ANALYST 7566 19-APR-87 00:00:00 3000 20
7934 MILLER CLERK 7782 23-JAN-82 00:00:00 1300 10
7369 SMITH CLERK 7902 17-DEC-80 00:00:00 800 20
7876 ADAMS CLERK 7788 23-MAY-87 00:00:00 1100 20
7900 JAMES CLERK 7698 03-DEC-81 00:00:00 950 30
7782 CLARK MANAGER 7839 09-JUN-81 00:00:00 2450 10
7566 JONES MANAGER 7839 02-APR-81 00:00:00 2975 20
7698 BLAKE MANAGER 7839 01-MAY-81 00:00:00 2850 30
7839 KING PRESIDENT 17-NOV-81 00:00:00 5000 10
7654 MARTIN SALESMAN 7698 28-SEP-81 00:00:00 1250 1400 30
7844 TURNER SALESMAN 7698 08-SEP-81 00:00:00 1500 0 30
7521 WARD SALESMAN 7698 22-FEB-81 00:00:00 1250 500 30
7499 ALLEN SALESMAN 7698 20-FEB-81 00:00:00 1600 300 30
14 rows selected.
Elapsed: 00:00:00.01
SQL> select * from emp order by job,deptno desc;
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
7902 FORD ANALYST 7566 03-DEC-81 00:00:00 3000 20
7788 SCOTT ANALYST 7566 19-APR-87 00:00:00 3000 20
7900 JAMES CLERK 7698 03-DEC-81 00:00:00 950 30
7369 SMITH CLERK 7902 17-DEC-80 00:00:00 800 20
7876 ADAMS CLERK 7788 23-MAY-87 00:00:00 1100 20
7934 MILLER CLERK 7782 23-JAN-82 00:00:00 1300 10
7698 BLAKE MANAGER 7839 01-MAY-81 00:00:00 2850 30
7566 JONES MANAGER 7839 02-APR-81 00:00:00 2975 20
7782 CLARK MANAGER 7839 09-JUN-81 00:00:00 2450 10
7839 KING PRESIDENT 17-NOV-81 00:00:00 5000 10
7844 TURNER SALESMAN 7698 08-SEP-81 00:00:00 1500 0 30
7654 MARTIN SALESMAN 7698 28-SEP-81 00:00:00 1250 1400 30
7521 WARD SALESMAN 7698 22-FEB-81 00:00:00 1250 500 30
7499 ALLEN SALESMAN 7698 20-FEB-81 00:00:00 1600 300 30
14 rows selected.
Elapsed: 00:00:00.01
SQL>
Maybe you are looking for
-
Trying to upload a file to an ftp folder
Hello, I am a recent convert to OS X from the Windows world and am trying to save a file on the ftp site for my work. I used the finder to connect to the FTP site, but I got an error saying that I couldn't change the file, when I tried to drop and dr
-
IPad asks for cellular data account to be set up
Since upgrading to iOS 8 our iPad Airs continually ask if we want to setup a data plan. We don't want to so we turn off Cellular in Settings. Does not help. iPad still asks if we want to setup a data plan several times a day. Very annoying. Has anyon
-
Handle error or warning message in updata task fm
Hi Experts, I have an requirement of creating materials. I am doing this in an update task FM. Now i want that if some error comes during creation of material then i display them in an alv on the screen.So inside the FM in case of error i populated i
-
need software for sd500a please help!! This question was solved. View Solution.
-
Black Bar on Screen with Text (accidental key combo, can't get rid of it)
In a mad typing dash 2 days ago, I accidentally hit a key combo that placed a black bar in the middle of my screen with the words "Gmail - friday - my email address" (I was in Gmail composing a message at the time). It's visible at all times, using a