Any advice on count when sum 0
Hi there
We would like to have 1 sql such that
count when sum of value in column > 0 . Problem is sum an aggregate function and also count.
As example imagine 2 customer records, one has a -ve value e.g -4 and 1 a positive value of +5 so sum of these values = +1. Such a customer we would like to include in the count and can't simply use having clause as we wish to include in report all sales reagrdless of whether > 0 but a separate count field to highlight the ones which are greater than 0
Current sql
select sum(value), cola..
from table
group by col1..
can't say
select count(case when sum(value) > 0 then distinct cust_id end)
as get ora-message about nested group by functions..
Anybody done such a thing before - would analytical functions work in this situation.
Many Thanks
Hi there,
Thanks very much for the replies.
One problem though, unfortunately the reporting tool we use is quite constrained and we can't implement the solutions proposed in it - they would have been preferable.
Example of data
table called transaction with all different types of transactions
Main fields, trans-code, cust_id, product_id, trans_qty, trans_date
Each row has a different trans code, e.g supply code, return code.
We wish to identify no of custs sold out. A customer could have several supply transaction records for the same product and potentially several different return transactions.
If the sum of all the supply transactions for a customer/product > 0 and the sum of all the credit transactions for a customer/product = 0 then we count this as a sell-out.
Is it possible to code this as an analytical function - if so how?
Many Thanks
Similar Messages
-
I am unable to download updates directly to iPad 2 , now trying to reinstall one from scratch but download keeps stopping and the restarting. Can you offer any advice, this happening when trying to download to laptop in itunes as well. Have tried to download on different broadband lines without success. Is this an apple problem due to high demand or something else?
Everything has worked well until about a month ago, up to date iOS 5 and itunes installed. Tried resetting numerous times, turned off all apps still no joy. Ipad was great but now feeling buying one was mistake. Also recent music purchase was useless and tunes would not play correctly.Since this is happening on the iPad and the computer, it might be worth a try to reboot your router - unplug it from power for about 30 seconds and then plug it in again.
Quit iTunes on the PC, reboot it and the iPad as well
Reboot the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider - let go of the buttons -
I have just purchased a new macbook and need to sync my iphone with itunes, i understand that you can only sync your phone with one itunes account. I do not want to wipe my iphone when syncing with this new itunes account. Any advice welcome
1) authorize iTunes on the new machine for your iTunes store account(s)
2) connect your device and right-click or control-click it in the iTunes Source list, then choose transfer purchases from the shortcut menu that appears.
3) sync the device
iTunes will wipe the iPhone but, since you transferred your purchases in the previous step, your content will be in your library and you can re-populate the iPhone with it. -
When streaming a movie from an imac to apple tv, is there a way of putting the imac display off? I find it a waste having the screen on in another room. Any advice?
No problem.
This is a user forum so you are not addressing Apple. There's nothing to fix, that's how home-sharing works. There would be no way for the ATV to recognize your library and display content if the computer is in sleep mode.
You can always airplay from an IOS device or use icloud if you don't wish to keep the computer on. -
I have read that you should resize the frame to 640 by 640 or 1000 x 1000, and have tried both. I shot the footage on canon 70d using 720p60fps, and edited the footage with iMovie. Its been frustrating to see the finished product look great on iPhone, iPad, or mac but once i post the video- the quality gets blurry when you focus on the faces that are in focus. My footage is basketball action shots from a high school game. Any advice would be huge, I been looking for an answer to this for a month.
Simple export a ProRes 422 file, upload that by itself. Facebook, Vimeo, YoutTube, etc, all compress the video themselves. So don't compress it first, just upload it and let them do their own compression.
-
I installed an iTunes update on my Windows Vista Laptop and iTunes wouldn't start saying it was missing MSVCR80.dll, now when I start Outlook it is going on about a mobileme error? Any advice? I'm tempted to not use iTunes ever again.
Troubleshooting issues with iTunes for Windows updates - MSVCR80
-
All I want to do is upgrade from 9 to 10 so that I can run my ipad.
When installing iTunes 10 I get an error message "Invalid Drive: F:|". ANy advice?Bissley,
I have received this error in the past and it is usually caused by Windows automatically changing your external drive letters when you install. There are two ways around it; first, follow the directions provided by b noir. Second, within iTunes go to Edit > Preferences > Advanced
Under the advanced options you'll see a recessed section called "iTunes Media folder location". Although you may have set this in the past it, if Windows changed your drive letters it will no longer be valid. Default is usually "C:\blah\blah\mymusic"
Changing it just a matter of clicking "change" and finding your music folder again or change your drive letter back (if it changed at all).
If Windows is changing your drive letters, it is best to set them yourself so that everytime you plug in the devices they use the letter you assigned. Here is a link for that process:
http://windows.microsoft.com/en-US/windows-vista/Change-add-or-remove-a-drive-le tter
Hope it helps. -
iTunes keeps freezing up when trying to sync my iPod on my Windows 7 computer. Will not go past "Determining which tracks to sync". Any advice?
Hello clarikr,
After reviewing your post, I have located an article that can help with iTunes for Windows. It contains a number of troubleshooting steps and helpful advice for the issue you are experiencing:
iTunes for Windows Vista, Windows 7, or Windows 8: Fix unexpected quits or launch issues - Apple Support
Thank you for contributing to Apple Support Communities.
Cheers,
BobbyD -
when I connect my iPhone, iPhoto opens and the phone begins charging but iTunes does not recognize it and I cannot sync. Any advice?
Howdy AndieKanaras,
It sounds like your iPhone is being recognized everywhere but in iTunes. I would use the troubleshooting for that issue in the following article, named:
If you don't see your connected device in iTunes for Mac
Thank you for using Apple Support Communities.
All the very best,
Sterling -
Please could you advise? ... After installing Itunes 11.3.1.2 on my Laptop and when reconnecting my iPad2 via USB, it is no longer visible under 'My Computer'. Any advice on resolving this issue would be most welcome. Thanks
Any one or a combo may help
Give your iPad a reset. Hold down the sleep and home keys for about 20 seconds. When you see the silver apple, let go and let it reboot and try again.
Try a different USB cord
Try a different USB port
Try rebooting your computer
Try closing/opening iTunes.
If you go through that and it doesn't work, try going into the control panel, add/remove programs. Uninstall iTunes, Apple Mobile Device Service, Apple Application Support. Then redownload and reinstall iTunes and try again -
I can no longer send photos in an email from my iphone 5. It uploads the photo the the "mew message" page and then it freezes! I can use safari and check my emails, and when the email part is frozen I can still use the rest of my phone. Any advice ?!?
Hi, ireland a.
I would recommend closing any open applications in multitasking and restarting the device. If unfamiliar with multitasking, I have included a screenshot on how to process an application close.
iOS: Force an app to close
Once these steps are processed, attempt to send the photo again.
iPhoto for iOS (iPhone): Send photos by email
http://support.apple.com/kb/PH3271
Regards,
Jason H. -
When I dock my Iphone it shows as a device on ITunes but there is nothing there - no managing tools no lists of apps, music anything just the device - any advice? I uninstalled and reinstalled ITunes
I found a solution !!!
The problem is that the font SEGOE UI MAGER (one of the fonts) is not installed.
When you go on this link, you can download the missing font !
http://fontzone.net/font-details/Segoe+UI/
download this, open it and go on install !
Then you open your Itunes and your Text is there again. Maybe its a little bit to big but, its there !!!
Wish you a nice day !! :-D -
I have a 1TB WD external hard disk, which suddenly cannot be detected in my system. When i connect the hardisk to the macbook, the disk appears and immediately disconnects with the message "Disk not properly ejected". Any advice ?
verify on another Mac if the same
WD is having issues with mavericks as you can see on the WD forum, did you install any WD software (never do that) when you connected the drive for the first time?
possible issue is a dead SATA bridge card or the new WD firmware w/ Mavericks.
SATA card issue
Your dead external hard drive is likely fine! Great hope for your 'faulty' external HD
http://community.wd.com/t5/External-Drives-for-Mac/bd-p/passport_mac
verify on another Mac if all possible -
I am using a WD My Passport Studio external hard drive as a Time Machine. I get the error that a back up folder could not be created when my iMac has been asleep, any advice. The hard drive is set set not to go to sleep.
Were you not plugged in via USB to begin with?
I would recommend performing some resets just to be on the safe side. Unplug the external HD, and try these steps:
http://support.apple.com/kb/HT3964
http://support.apple.com/kb/HT1379 -
Hello, does anyone have any advice on how to sort photos in an albumn on an Iphone by date of photo? I've ordered them all in my Pictures but then when I sync them across through Itunes, they all end up in a jumble on my phone. Thanks!
When viewing an album on the iPhone you can tap "Photos" at the bottom and that will show all photos by date. Unfortunately though it is all photos, not just the album you are currently viewing.
What I have done is the following. On the computer I have a main folder (e.g. iPhone photos) and then make sub-folders within that. Placing photos that will be synched to the iPhone into various subfolders gives quite a bit of organizational capablility. In iTunes when you select the main folder to sync, the sub-folders will show on the iPhone as separate albums. Beyond that, in one case where I really wanted a specific sort within an album I renamed the photos on the computer (something like A-picxxx, B-picxxx) so they sorted on the computer alphabetically in the order I want on the phone. That sort order was maintained after the sync.
Note that each time you sync using iTunes, the non-Camera Roll pictures on the phone will be set to match the current iTunes settings/photos -- so you can experiment.
Maybe you are looking for
-
Custom Search Portlet : Find all item created in a such year
Hi, I'd like to find the way to search for items created in a such year. I have added the 'created on' attribute in the form, but the operator is equal lower of higher. What I need is to find the item created from 1st January to 31 December. Does any
-
What are the defaul username and password for SQL Plus ?
hello, what are the defaul username and password for SQL Plus ? i'm using the client 11.2.0.1
-
I get an error message when I try to remove it. It says something about Windows XP Service Pack 3 Help! I need to get my photoshop back!
-
How to test RAM and HDD (Hard Drive).
Introduction HP machines have built-in Bios testers for RAM and HDD's. To use them you need to enter Bios by pressing F10 on startup. They are placed under ' Diagnostics menu '. Why I wrote this guide and complicate whole situation? There are three
-
Unable to download apps without app world
I have problems downloading apps without my app world as it doesn't want to download. But it is possible to download without app world. When I get to the page where I have to sign in my BB I.D it links me to another page that says my cookies are turn