Top 5 and bottom 5 selling products
My source table contains
Book_id Quantity Selling_date
My problem is to find out top and bottom 5 selling books for a particular year.
For example,
For year 2010,
Top_5 Bottom_5
b1 b2
b6 b8
In this way I want to get output for watever year I want.
Waiting for a reply,
Thank You.
Hi,
Welcome to the forum!
915235 wrote:
My source table contains
Book_id Quantity Selling_date
My problem is to find out top and bottom 5 selling books for a particular year.
For example,
For year 2010,
Top_5 Bottom_5
b1 b2
b6 b8
In this way I want to get output for watever year I want.Here's one way to get the results for a given year:
WITH got_nums AS
SELECT book_id
, SUM (quantity) AS total_quantity
, TRUNC (selling_date, 'YEAR') AS selling_year
, RANK () OVER ( ORDER BY SUM (quantity) DESC
) AS t_num
, RANK () OVER ( ORDER BY SUM (quantity) ASC
) AS b_num
FROM source_table
WHERE EXTRACT (YEAR FROM selling_date) = 2010 -- or whatever
GROUP BY book_id
SELECT *
FROM got_nums
WHERE t_num <= 5
OR b_num <= 5
, t_num
;What do you want if there happens to be a tie? For example, if you have have 7 different books that only sell 1 copy in the year? (I assume you don;t want to include books that sells 0 copies.) The query above would include all 7 in the bottom 5, because they all have an equal claim to being in the bottom 5. If you want to show exactly 5 books, regardless of ties, then use ROW_NUMBER instead of RANK, and add more expressions to the analytic ORDER BY clauses to choose the 5 you want.
It looks liek there's another part to this problem, which is displaying the book_ids in 2 columns, rather than 1. That's called a Pivot , and how to do it depends on your version of Oracle, and also on how you want to deal with ties. See the forum FAQ {message:id=9360005}
Waiting for a reply,Of course you are. Saying so makes it sound like you think you're especially impoortant and deserve special attention. That comes across as rude, so don't say things like "Urgent", "ASAP" or "Waiting for a reply" in your messages.
Similar Messages
-
Hi all ,
Can anyone help me in solving the following problem ..
How to get top 5 and bottom 5 selling books in a single query
Eg:
Book name No.sold
A 45
B 78
C 8
D 6
T 66
E 33
AA 35
AB 95
AC 51
AD 5
AE 42
desired output :
Top 5 bname | bottom 5 bname
AB AD
B D
T C
AC E
A AA
Thanks in advance
SanaSince, in general, more than one book can have same no_sold, more than 5 books can have top/bottom no_sold. If you want all 5 top and bottom selling books, use:
with t as (
select book_name,
no_sold,
dense_rank() over (order by no_sold desc) rnk_top,
dense_rank() over (order by no_sold) rnk_bottom,
row_number() over (order by no_sold desc) rn_top,
row_number() over (order by no_sold) rn_bottom
from books
select t1.book_name,
t2.book_name,
t1.no_sold top_no_sold,
t2.no_sold bottom_no_sold,
nvl(t1.rnk_top,t2.rnk_bottom) rank
from t t1
full join
t t2
on (
t2.rn_bottom = t1.rn_top
where t1.rnk_top <= 5
and t2.rnk_bottom <= 5
order by nvl(t1.rn_top,t2.rn_bottom)
BO BO TOP_NO_SOLD BOTTOM_NO_SOLD RANK
AB AD 95 5 1
B D 78 6 2
T C 66 8 3
AC E 51 33 4
A AA 45 35 5
SQL> If all you want is any 5 top/bottom sold books:
with t as (
select book_name,
no_sold,
row_number() over (order by no_sold desc) rn_top,
row_number() over (order by no_sold) rn_bottom
from books
select t1.book_name,
t2.book_name,
t1.no_sold top_no_sold,
t2.no_sold bottom_no_sold,
t1.rn_top rn
from t t1
inner join
t t2
on (
t1.rn_top <= 5
and
t2.rn_bottom <= 5
and
t2.rn_bottom = t1.rn_top
order by rn
BO BO TOP_NO_SOLD BOTTOM_NO_SOLD RN
AB AD 95 5 1
B D 78 6 2
T C 66 8 3
AC E 51 33 4
A AA 45 35 5
SQL> SY. -
Hi, I have a question about using the top N and bottom N conditions in a query. If I set my condition to show the bottom 1, and there are multiple rows that have 0%, then how does the query determine which row to display as the bottom 1?
I ask this because I have such a query and result set as described above. The bottom 1 that is returned actually shows up in the middle of the list when I display all rows.
Any help is appreciated. Thanks.Hi Audrey,
this is an excellent question. It took me a while to find the answer. The OLAP engine is using the standard ABAP SORT statement to rank the values.
TOP N:
SORT c_t_rank BY value DESCENDING.
BOTTOM N:
SORT c_t_rank BY value.
Now the SORT statement does not preserve the original order of the records. If values are identical, the outcome of the sort is not defined. Potenially it could be different every time you execute the query. The SORT statement also has an option to preserve the order of the records, but because this has a performance impact, it is not used by the OLAP engine.
Kind regards,
Marc
SAP NetWeaver RIG, US BI -
Darker top third and bottom third this AM
I came down this morning and when I woke the computer [PowermacG5] from sleep saw something I'd never seen before = my 30" ACD came up and the top and the bottom 1/3 were darker than the middle 1/3 - I checked the pref. and adjusted the brightness but it didn't improve it = I then rebooted the whole computer and now it's gone = I'm certainly glad it's gone but thought I would ask whether anyone knows the cause/fix etc.
I had just upgraded to 10.4.9 but don't see the correlation, at least yetHi
Normally a partially dimmed LCD indicates a problem with the back light(s). Assuming the 30" ACD has three (top, middle and bottom), it seems unlikely though that two would temporarily fail simultaneously and then work again after a reboot. I guess one option would be to keep an eye on it to see whether it happens again. -
Changing the top cover and bottom cover
hi,
i want to ask if i change both top and bottom cover of my white macbook myself(macbook model 5.2) does my AppleCare (still got 1 more year valid) still valid for those component inside like the scren, motherboard? bec now there are too much obvious scratches ...
thank you ~If Apple sees the inside has been worked on before, they may refuse warranty. It may be up to the tech's discretion that is working on it.
Check out the new remodeled MacOSG website! 24-hour Apple-related news & support.
MacOSG: An Apple User Group iTunes: MacOSG Podcast Follow us on Twitter: MacOSG -
My phone is dead it will not turn back on after taking a step I have used in the past when I have had issues with the phone. In the past I haeld the top button and the button on the face down and it will turn black then the apple sign comes up then off. I can then turn it back on and it seems to be reset and all is good not so today. It will not turn back on.
1. Plug phone into AC adaptor and charge for at least 30 minutes
2. If not on, reset phone: press both home and power buttons for at least 10 seconds, releasing when the Apple logo appears.
If no reponse to above, there is hardware damage and you need to take it to Apple or whoever provides iPhone service in your country. -
I only print the top line and bottom line, content in middle doesn't print
When I print an email only the very top line at the top of the page prints and the very bottom line at the very bottom of the page print. For example the bottom line says page 1 of 1 and then on the other side the date and time. Top line has the web address. When I open internet explorer and print and email I have no problems. This just started out of the blue a few updates ago.
If there isn't a Page Setup in the Print Dialog, open Text Edit>Edit>Page Setup, check borders there or use Custom Page setup & save.
-
ApplicationControlBar with top edges and bottom round off square
desire to make a ApplicationControlBar as the image that follows below. I searched the internet and found nothing that helps me to change the edges of the object
Hi,
If you create an application skin then find the section topGroup, you just add each corner radius in, below is thesection with left top corner radius
added.
David.
<s:Group id="topGroup" minWidth="0" minHeight="0"
includeIn="normalWithControlBar, disabledWithControlBar" >
<!-- layer 0: control bar highlight -->
<s:Rect left="0" right="0" top="0" bottom="1" topLeftRadiusX="10" topLeftRadiusY="10">
<s:stroke>
<s:LinearGradientStroke rotation="90" weight="1">
<s:GradientEntry color="0xFFFFFF" />
<s:GradientEntry color="0xD8D8D8" />
</s:LinearGradientStroke>
</s:stroke>
</s:Rect>
<!-- layer 1: control bar fill -->
<s:Rect left="1" right="1" top="1" bottom="2" topLeftRadiusX="10" topLeftRadiusY="10" >
<s:fill>
<s:LinearGradient rotation="90">
<s:GradientEntry color="0xEDEDED" />
<s:GradientEntry color="0xCDCDCD" />
</s:LinearGradient>
</s:fill>
</s:Rect>
<!-- layer 2: control bar divider line -->
<s:Rect left="0" right="0" bottom="0" height="1" alpha="0.55" topLeftRadiusX="10" topLeftRadiusY="10">
<s:fill>
<s:SolidColor color="0x000000" />
</s:fill>
</s:Rect> -
The bottom half is blank and useless.
hello, can you try to replicate this behaviour when you launch firefox in safe mode once? if not, maybe an addon is interfering here...
[[Troubleshoot extensions, themes and hardware acceleration issues to solve common Firefox problems]] -
Gap between left side of top case and bottom case(white)
I bought this white macbook about one month ago, then I find a gap.
When I went to service provider, they said that it's a problem during product and can not been solved. My friends who also buy macbook white recently have this problem too.
http://www.weiphone.com/viewthread.php?tid=294720&extra=&frombbs=1#zoompicture here
http://f18.yahoofs.com/users/46185c91ze18bb834/bd9f/_sr/e735.jpg?phIjmsJBdL9jFhsR -
Set top and bottom inset spacing values in Text Frame Options via jsx script
I am looking for a way to set the top and bottom inset spacing values only to 2 points in Text Frame Options via a .jsx scrpt.
For years, I have used a script that sets Preferences, such as:
with(app.storyPreferences){
opticalMarginAlignment = false;
opticalMarginSize = 12; // pts
I would like to add the code to this same script that would make Top = 0p2 and Bottom 0p2 but leave Left and Right as 0p0.
Any help would be greatly appreciated.Here is the full .jsx file that we now use to set preferences.
Ideally, this could be modified to include setting any text frame created to have 0p2 inset Top and Bottom, but 0p0 Left and Right:
//ApplicationTextDefaults
//An InDesign CS2 JavaScript
//Sets the application text defaults, which will become the text defaults for all
//new documents. Existing documents will remain unchanged.
with(app.textDefaults){
alignToBaseline = false; // align to baseline grid
try {
// appliedFont = app.fonts.item("Times New Roman");
appliedFont = app.fonts.item("Helvetica");
catch (e) {}
try {
fontStyle = "Medium";
catch (e) {}
autoleading = 100;
balanceRaggedLines = false;
baselineShift = 0;
capitalization = Capitalization.normal;
composer = "Adobe Paragraph Composer";
desiredGlyphScaling = 100;
desiredLetterSpacing = 0;
desiredWordSpacing = 100;
dropCapCharacters = 0;
if (dropCapCharacters != 0) {
dropCapLines = 3;
//Assumes that the application has a default character style named "myDropCap"
//dropCapStyle = app.characterStyles.item("myDropCap");
fillColor = app.colors.item("Black");
fillTint = 100;
firstLineIndent = "0pt";
// firstLineIndent = "14pt";
gridAlignFirstLineOnly = false;
horizontalScale = 100;
hyphenateAfterFirst = 3;
hyphenateBeforeLast = 4;
hyphenateCapitalizedWords = false;
hyphenateLadderLimit = 1;
hyphenateWordsLongerThan = 5;
hyphenation = true;
hyphenationZone = "3p";
hyphenWeight = 9;
justification = Justification.leftAlign;
keepAllLinesTogether = false;
keepLinesTogether = true;
keepFirstLines = 2;
keepLastLines = 2;
keepWithNext = 0;
kerningMethod = "Optical";
kerningValue = 0;
leading = 6.3;
// leading = 14;
leftIndent = 0;
ligatures = true;
maximumGlyphScaling = 100;
maximumLetterSpacing = 0;
maximumWordSpacing = 160;
minimumGlyphScaling = 100;
minimumLetterSpacing = 0;
minimumWordSpacing = 80;
noBreak = false;
otfContextualAlternate = true;
otfDiscretionaryLigature = true;
otfFigureStyle = OTFFigureStyle.proportionalOldstyle;
otfFraction = true;
otfHistorical = true;
otfOrdinal = false;
otfSlashedZero = true;
otfSwash = false;
otfTitling = false;
overprintFill = false;
overprintStroke = false;
pointSize = 6.3;
// pointSize = 11;
position = Position.normal;
rightIndent = 0;
ruleAbove = false;
if(ruleAbove == true){
ruleAboveColor = app.colors.item("Black");
ruleAboveGapColor = app.swatches.item("None");
ruleAboveGapOverprint = false;
ruleAboveGapTint = 100;
ruleAboveLeftIndent = 0;
ruleAboveLineWeight = .25;
ruleAboveOffset = 14;
ruleAboveOverprint = false;
ruleAboveRightIndent = 0;
ruleAboveTint = 100;
ruleAboveType = app.strokeStyles.item("Solid");
ruleAboveWidth = RuleWidth.columnWidth;
ruleBelow = false;
if(ruleBelow == true){
ruleBelowColor = app.colors.item("Black");
ruleBelowGapColor = app.swatches.item("None");
ruleBelowGapOverprint = false;
ruleBelowGapTint = 100;
ruleBelowLeftIndent = 0;
ruleBelowLineWeight = .25;
ruleBelowOffset = 0;
ruleBelowOverprint = false;
ruleBelowRightIndent = 0;
ruleBelowTint = 100;
ruleBelowType = app.strokeStyles.item("Solid");
ruleBelowWidth = RuleWidth.columnWidth;
singleWordJustification = SingleWordJustification.leftAlign;
skew = 0;
spaceAfter = 0;
spaceBefore = 0;
startParagraph = StartParagraph.anywhere;
strikeThru = false;
if(strikeThru == true){
strikeThroughColor = app.colors.item("Black");
strikeThroughGapColor = app.swatches.item("None");
strikeThroughGapOverprint = false;
strikeThroughGapTint = 100;
strikeThroughOffset = 3;
strikeThroughOverprint = false;
strikeThroughTint = 100;
strikeThroughType = app.strokeStyles.item("Solid");
strikeThroughWeight = .25;
strokeColor = app.swatches.item("None");
strokeTint = 100;
strokeWeight = 0;
tracking = 0;
underline = false;
if(underline == true){
underlineColor = app.colors.item("Black");
underlineGapColor = app.swatches.item("None");
underlineGapOverprint = false;
underlineGapTint = 100;
underlineOffset = 3;
underlineOverprint = false;
underlineTint = 100;
underlineType = app.strokeStyles.item("Solid");
underlineWeight = .25
verticalScale = 100;
//Units & Increments preference panel
//Must do this to make sure our units that we set are in points. The vert and horiz
//units that get set default to the current measurement unit. We set it to points
//so we can be sure of the value. We'll reset it later to the desired setting.
with(app.viewPreferences){
horizontalMeasurementUnits = MeasurementUnits.points; // Ruler Units, horizontal
verticalMeasurementUnits = MeasurementUnits.points; // Ruler Units, vertical
//General preference panel
with(app.generalPreferences){
pageNumbering = PageNumberingOptions.section; // Page Numbering, View
toolTips = ToolTipOptions.normal; // Tool Tips
// Not supported in CS4
// toolsPalette = ToolsPaletteOptions.doubleColumn; // Floating Tool Palette
completeFontDownloadGlyphLimit = 2000; // Always Subset Fonts...
try {
//Wrapped in try/catch in case it is run with CS4 and earlier to avoid the error
preventSelectingLockedItems = false; // Needed for CS5+
catch (e) {}
//Type preference panel
with (app.textEditingPreferences){
tripleClickSelectsLine = true; // Triple Click to Select a Line
smartCutAndPaste = true; // Adjust Spacing Automatically when Cutting and Pasting Words
dragAndDropTextInLayout = false; // Enable in Layout View
allowDragAndDropTextInStory = true; // Enable in Story Editor
with(app.textPreferences){
typographersQuotes = true; // Use Typographer's Quotes
useOpticalSize = true; // Automatically Use Correct Optical Size
scalingAdjustsText = true; // Adjust Text Attributes when Scaling
useParagraphLeading = false; // Apply Leading to Entire Paragraphs
linkTextFilesWhenImporting = false; // Create Links when Placing Text and Spreadsheet Files
// Missing following (Font Preview Size, Past All Information/Text Only)
//Advanced Type preference panel
with(app.textPreferences){
superscriptSize = 58.3; // Superscript, size
superscriptPosition = 33.3; // Superscript, position
subscriptSize = 58.3; // Subscript, size
subscriptPosition = 33.3; // Subscript, position
smallCap = 70; // Smallcap
with(app.imePreferences){
inlineInput = false; // Use Inline Input for Non-Latin Text
//Composition preference panel
with(app.textPreferences){
highlightKeeps = false; // Keep Violations
highlightHjViolations = false; // H&J Violations
highlightCustomSpacing = false; // Custom Tracking/Kerning
highlightSubstitutedFonts = true; // Substituted Fonts
highlightSubstitutedGlyphs = false; // Substituted Glyphs
justifyTextWraps = false; // Justify Text Next to an Object
abutTextToTextWrap = true; // Skip by Leading
zOrderTextWrap = false; // Text Wrap Only Affects Text Beneath
//Units & Increments preference panel
with(app.viewPreferences){
rulerOrigin = RulerOrigin.spreadOrigin; // Ruler Units, origin
// These are set at the end of the script after all the changes have been made
// horizontalMeasurementUnits = MeasurementUnits.points; // Ruler Units, horizontal
// verticalMeasurementUnits = MeasurementUnits.inches; // Ruler Units, vertical
pointsPerInch = 72; // Point/Pica Size, Points/Inch
cursorKeyIncrement = 1; // Keyboard Increment, Cursor Key
with(app.textPreferences){
baselineShiftKeyIncrement = 2; // Keyboard Increment, Baseline Shift
leadingKeyIncrement = 2; // Keyboard Increment, Size/Leading
kerningKeyIncrement = 20; // Keyboard Increment, Kerning
//Grids preference panel
with(app.gridPreferences){
baselineColor = UIColors.lightBlue; // Baseline Grid, Color
baselineStart = 48; // Baseline Grid, Start
baselineDivision = 6; // Baseline Grid, Increment Every
baselineViewThreshold = 50; // Baseline Grid, View Threshold
baselineGridRelativeOption = BaselineGridRelativeOption.topOfPageOfBaselineGridRelativeOption; // Baseline Grid, Relative To
gridColor = UIColors.lightGray; // Document Grid, Color
horizontalGridlineDivision = 12; // Document Grid, Horizontal, Gridline Every
horizontalGridSubdivision = 12; // Document Grid, Horizontal, Subdivisions
verticalGridlineDivision = 12; // Document Gird, Vertical, Gridline Every
verticalGridSubdivision = 12; // Document Grid, Vertical, Subdivisions
gridsInBack = true; // Grids in Back
documentGridSnapto = false; // snap to grid or not
documentGridShown = false; // show document grid
//Guides & Pasteboard preference panel
with(app.documentPreferences){
marginGuideColor = UIColors.violet; // Color, Margins
columnGuideColor = UIColors.magenta; // Color, Columns
with(app.pasteboardPreferences){
bleedGuideColor = UIColors.fiesta; // Color, Bleed
slugGuideColor = UIColors.gridBlue; // Color, Slug
previewBackgroundColor = UIColors.lightGray; // Color, Preview Background
minimumSpaceAboveAndBelow = 72; // Minimum Vertical Offset
with(app.viewPreferences){
guideSnaptoZone = 4; // Snap to Zone
with(app.guidePreferences){
guidesInBack = false; // Guides in Back
//Dictionary preference panel
with(app.dictionaryPreferences){
composition = ComposeUsing.both; // Hyphenatin Exceptions, Compose Using
mergeUserDictionary = false; // Merge User Dictionary into Document
recomposeWhenChanged = true; // Recompose All Stories When Modified
// Missing (Lang, Hyph, Spelling, Double Quotes, Single Quotes)
//Spelling preference panel
with(app.spellPreferences){
checkMisspelledWords = true; // Find, Misspelled Words
checkRepeatedWords = true; // Find, Repeated Words
checkCapitalizedWords = true; // Find, Uncapitalized Words
checkCapitalizedSentences = true; // Find, Uncapitalized Sentences
dynamicSpellCheck = true; // Enable Dynamic Spelling
misspelledWordColor = UIColors.red; // Color, Misspelled Words
repeatedWordColor = UIColors.green; // Color, Repeated Words
uncapitalizedWordColor = UIColors.green; // Color, Uncapitalized Words
uncapitalizedSentenceColor = UIColors.green; // Color, Uncapitalized Sentences
//Autocorrect preference panel
with(app.autoCorrectPreferences){
autoCorrect = true; // Enable Autocorrect
autoCorrectCapitalizationErrors = false; // Autocorrect Capitalization
// Missing (Language, Misspelled word pairs)
//Display Performance preference panel
with(app.displayPerformancePreferences){
defaultDisplaySettings = ViewDisplaySettings.typical; // Preserve Object-Level
persistLocalSettings = false;
// Missing (antialiasiing, greek below
//Story Editor Display preference panel
with(app.galleyPreferences){
textColor = InCopyUIColors.black; // Text Color
backgroundColor = InCopyUIColors.white; // Background
smoothText = true; // Enable Anti-Aliasing
antiAliasType = AntiAliasType.grayAntialiasing; // Type
cursorType = CursorTypes.standardCursor; // Cursor Type
blinkCursor = true; // Blink
// Missing (Font, Size, Line Spacing & Theme)
//File Handling preference panel
with(app.generalPreferences){
includePreview = true; // Always Save Preview Images with Doc
previewSize = PreviewSizeOptions.medium; // Preview Size
with(app.clipboardPreferences){
preferPDFWhenPasting = false; // Prefer PDF When Pasting
copyPDFToClipboard = true; // Copy PDF to Clipboard
preservePdfClipboardAtQuit = false; // Preserve PDF Data at Quit
// Missing (Enable Version Cue)
// Optical margin (hanging punctuation, outside margins)
with(app.storyPreferences){
opticalMarginAlignment = false;
opticalMarginSize = 12; // pts
//Wrap Up (do at end of script)
//Units & Increments preference panel
//Must do this to make sure our units that we set are in points. The vert and horiz
//units that get set default to the current measurement unit. We set it to points
//so we can be sure of the value. We'll reset it later to the desired setting.
with(app.viewPreferences){
horizontalMeasurementUnits = MeasurementUnits.picas; // Ruler Units, horizontal
verticalMeasurementUnits = MeasurementUnits.inches; // Ruler Units, vertical
// These two flags are turned off to avoid the error message about
// missing image links when InDesign opens an ad. This can especially
// be a problem when doing batch processes.
with(app.linkingPreferences){
checkLinksAtOpen = false; // checkbox: true/false
findMissingLinksAtOpen = false; // checkbox: true/false -
HOW TO GET TOP AND BOTTOM RECORDS IN SQL STATEMENT, URGENT
Hi,
I want to get the TOP 2 and BOTTOM 2 records (TOP 2 SAL , BOTTOM 2 SAL) from the following query result for each department . How do I get it using a SQL statement ? Thanks
SQL> SELECT A.DNAME, B.ENAME, B.SAL FROM DEPT A, EMP B WHERE A.DEPTNO = B.DEPTNO ORDER BY DNAME, SAL
DNAME------------ENAME--------SAL
ACCOUNTING-------KING--------5000
----------------CLARK--------2450
---------------MILLER--------1300
RESEARCH--------SCOTT--------3000
-----------------FORD--------3000
----------------JONES--------2975
----------------ADAMS--------1100
----------------SMITH---------800
SALES-----------BLAKE--------2850
----------------ALLEN--------1600
---------------TURNER--------1500
-----------------WARD--------1250
---------------MARTIN--------1250
----------------JAMES---------950
14 rows selected.Search for "top-N query" in oracle doucmentation.
Example :
for top 2
SELECT * FROM
(SELECT empno FROM emp ORDER BY sal)
WHERE ROWNUM < 3;
for bottom 2
SELECT * FROM
(SELECT empno FROM emp ORDER BY sal desc)
WHERE ROWNUM < 3; -
Eliminate top and bottom 20% records from detail section.
Post Author: optikconnex
CA Forum: Crystal Reports
I have two groups, Group1 is by PartNum and Group2 is by WorkCenter. I also have 1 detail section. I want to only show/select the middle 60% of records, or to reword that I want to eliminate the top 20% and bottom 20% of the detail records. How do I do this? I have tried using the Nth Largest and Nth Smallest and even Pth Percentile functions but I just don't seem to know how to use them correctly since I need this done at the detail level and not group level.
ThanksPost Author: kcheeb
CA Forum: Crystal Reports
You could try hiding the records based on your formula but I suspect that'll throw your group totals off.
You might be best off using SQL to do that for you. Most of the major databases have Datamart type functions you can use. -
Eliminate top and bottom 20% of detail records
Post Author: optikconnex
CA Forum: General
I have two groups, Group1 is by PartNum and Group2 is by WorkCenter. I also have 1 detail section. I want to only show/select the middle 60% of records, or to reword that I want to eliminate the top 20% and bottom 20% of the detail records. How do I do this? I have tried using the Nth Largest and Nth Smallest and even Pth Percentile functions but I just don't seem to know how to use them correctly since I need this done at the detail level and not group level.
ThanksPost Author: kcheeb
CA Forum: Crystal Reports
You could try hiding the records based on your formula but I suspect that'll throw your group totals off.
You might be best off using SQL to do that for you. Most of the major databases have Datamart type functions you can use. -
Query for top 10 selling products and their current stock
Hi ppl
I am using the sales overview cube 0SD_C03 to get top 10 selling products. What I want is to get the current stock available of the top 10 products from Material Stocks/Movements cube 0IC_C03. From what I know, we have to make a multiprovider to get this information. Can anyone guide me how to go about it?Hello Javed,
You can use Replacement path for this.
1.Create a report for Top 10 Products in InfoCube 0SD_C03 - Exampls Report A
2.Create another report with Stock and use a variable for Product with processing type replacement path in InfoCube0IC_C03 - Example Report B
3. In Report B and assing the Report A to this variable.
When you execute the Report B it will execute the Report A in background and displays it in Report B.
Hope it helps,
thanks
Chandran
Maybe you are looking for
-
Remote Desktop Admin - Scanner can't see clients.
Hello, I have a couple of copies of Remote Desktop UNL admin packages that are used in a education environment. Remote desktop has been working great in all but one lab, where the scanner has trouble finding any machines. It may sporadically find a r
-
Sun Oner Application Server 7 Admin Console doesn't start
When I start the Admin Console for Sun One Application Server 7, and after I login, the admin console doesn't display in the browser. I have tried starting the admin console with IE and Netscape browser, but the admin console has failed to start in e
-
Condition to propose only at the time of IV
Hi, I have a requirement where in i want to have one mark up condition which should be seen on PO It should not have any effect at the time of GR ,but the value should be proposed at the time of IV PO PRICE-100 MARK UP-10 GR/IR-100 STOCK-100 Invoice-
-
Steps in configuring availability check for STO Prs
I want to configure Availability check for stock transport PRS. what are the steps.
-
Comment on this Lightroom forum
The volume of traffic on this forum is so great and varied, the forum needs a different structure. One with categories of discussions. As the forum is now stuctured, you have to wade through days of postings to find posts relevant to your problem. Pl