function formula and percentage of power

Hello

I need to create this kind of report and does not know how to get the formula for the annual.

Total countCancelledRestRetention rate90 daysAnnualAnnual renewal
127 3205 390124 86795,28%4.7%17.6%82.4%
128 4504 890124 58995,23%4.8%17.7%82.3%

In MS excel, the formula for the annual is = 1-(retention rate) ^ 4 and the result is a percentage.

All are correct except for annual renewal and annualized data.

I get no response percentage so instead of the figure above, I'm 82415038.70 (for example no. 1 above) of the query below.

Can someone please? Thank you very much




Select c.prod, sc.total_count, count (c.id) as cancelled,

SC.total_count - count (c.id) as rest,

Round ((sc.total_count - count (c.id)) sc.total_count * 100.2) as Retention_Rate,

round (100-((sc.total_count - count (c.id)) sc.total_count * 100), 2) as "90 days."

(round ((100-((sc.total_count - count (c.id)) sc.total_count * 100)), 2)) * 4 as annual.

round (100-(100-((sc.total_count - count (c.id)) sc.total_count * 100)) * 4, 2) as Annualized_Renewal

Customer c,.

(select count (id) as total_count, client prod)

where start_delivery < = sysdate

and paid_until > = sysdate

and cancellation_date > = sysdate

and cancellation_code =' '

Group of prod

) sc

where c.cancellation_date between & < name = "Date" default = ' 01/01/2013' type = ' date' >

and & < name = "Date up to the" default = ' 31/03/2013' type = 'date' >

and c.prod = sc.prod

C.prod group, sc.total_count

I think that there are not a lot of space for improvement of this query.

Like Chris mentioned the exponential function in SQL is POWER.

However, in excel the percentage value is always be between 0 and 1. As 0.83. And this value is then switched on.

From the mathematical point of view, it's the value you need to use (0.83 ^ 4 instead of 83 ^ 4)...

But lets start at your request. You select twice in the customers table. This is not necessary and is simply your slow query.

Here is an approach to circumevent that and other issues.

As I don't have your customer table, I can not really test that. But try to follow step by step and adapt it to your needs.

Step 1 - create a query with countdown and canceled the County.

not tested

   select count(case when sysdate between start_delivery and paid_until
                     and cancellation_date>=sysdate
                     and cancellation_code=' '
                then 1 end ) as total_count
         ,count(case when c.cancellation_date between :date_from and :date_until
                then 1 end ) as cancelled
         ,prod
   from customer
   group by prod;

Step 2 - use the previous query and add the retention and the annualized rate

with cust as (
   select count(case when sysdate between start_delivery and paid_until
                     and cancellation_date>=sysdate
                     and cancellation_code=' '
                then 1 end ) as total_count
         ,count(case when c.cancellation_date between :date_from and :date_until
                then 1 end ) as cancelled
         ,prod
   from customer
   group by prod
   )
select prod, total_count, cancelled
          ,total_count - cancelled as remaining
          ,1 -(cancelled / total_count ) as retention_rate
          ,power(1 -(cancelled / total_count ),4) as annualized_rate
from cust;

Step 3 - format the output

with cust as (
   select count(case when sysdate between start_delivery and paid_until
                     and cancellation_date>=sysdate
                     and cancellation_code=' '
                then 1 end ) as total_count
         ,count(case when c.cancellation_date between :date_from and :date_until
                then 1 end ) as cancelled
         ,prod
   from customer
   group by prod
   )
   , cust_ret as
   (select prod, total_count, cancelled
          ,total_count - cancelled as remaining
          ,1 -(cancelled / total_count ) as retention_rate
          ,power(1 -(cancelled / total_count ),4) as annualized_rate
     from cust)
select prod
     , total_count
     , cancelled
     , remaining
     , round(retention_rate * 100,2) as ret_rate_percent
     , round(1-(retention_rate * 100),1) as ninety_days
     , round(1-(annualized_rate * 100),1) as annual
     , round(annualized_rate * 100,2) as annual_rate_perc
from cust_ret;

Tags: Database

Similar Questions

  • Satellite A660 - 1 H 7 function keys and Logo lights went out

    It may seem a little ridiculous to the experience of users of Toshiba laptops, BUT I have my laptop recently and there are a few days, I've lost the lights on my (next to the power switch) function buttons and the 'objective' logo in the lower left corner.

    I don't know if I've done something to turn them off?
    Unfortunately I don't know how to get the lights back on.

    Can someone please help and tell me how (step by step if poss) to get back them.

    Thank you in advance.

    > I don't know if I've done something to turn them off?
    > Unfortunately I don't know how to get the lights back on.

    As far as I know this feature is controlled by Backlight.exe and you can find it in
    Program Files\Toshiba\TBS\Backlight.exe

    It is usually part of the VAP (value added package) to reinstall this package should help you get it working again.

    You can also assign this file exe button again with the Support of TOSHIBA Button tool

    Someone wrote in the forum:
    + When I go into "TOSHIBA button Support", I only have empty fields with the choice in the background to set "TOSHIBA Assist" or "Presentation". Empty fields are 'Description', 'Option' and 'path of the target. There is a button 'Browse' to select a program manually, but I have no idea where the exe "backlight on / off" is, when one exists. +

  • I can't turn on my wireless (wifi) on my laptop, even when I tried to press the function key and F8

    I can't turn on my wireless (wifi) on my laptop, even when I tried to press the function key and F8. I have a toshiba laptop, and there is no switch on the side of my computer what is expected? Help someone?

    Hello

    My older Toshiba has a power switch WiFi.

    My new Toshiba has a WiFi switch above the F keys, although I do not know which varies
    by model. So check with Toshiba support, their documentation online and drivers, and
    ask in their forums where there will be others with the same model.

    Toshiba - Forums
    http://laptopforums.Toshiba.com/

    Toshiba - Contacts
    http://www.CSD.Toshiba.com/cgi-bin/TAIS/support/JSP/navShell.jsp?CF=su_contact

    Toshiba - drivers - access your model
    http://www.CSD.Toshiba.com/cgi-bin/TAIS/support/JSP/home.jsp?NAV=download

    Toshiba - Support
    http://www.CSD.Toshiba.com/cgi-bin/TAIS/support/JSP/home.jsp

    I hope this helps.

    Rob Brown - Microsoft MVP<- profile="" -="" windows="" expert="" -="" consumer="" :="" bicycle=""><- mark="" twain="" said="" it="">

  • Problem of nested function Ago and to this day

    Hello
    in my SPR I suite Time hierarchy:

    Year
    Quarter
    Month

    and a table of facts is store that contains the monthly measure "number of hearing aids supplied."

    I have to calculate PY_QTD, versions PY_YTD of the above measure.

    I tried to use integrated there is time and day of the following functions:

    PY_QTD

    To date (there are ("number of hearing aids Delivered", 1, "Time.Year"), "Time.Quarter")

    PY_YTD

    To date (there are ("number of hearing aids Delivered", 1, "Time.Year"), "Time.Year")

    but when I check the consistency I have error that says about "you can nest functions Ago and to this day.

    There is another way to calculate this? Can you help me?

    Thank you

    Giancarlo

    Calculate PY_YTD use the below for your case:

    Create a logical column
    AIDS sent for a YEAR with a formula such as that DAY ("number of hearing pronounced"), "Time.Year")
    then create another logical column as
    PY_YTD of AIDS come with formula as there is ("YTD","Time.Year delivered AIDS", 1)

    This will work for sure...

  • Satellite L455 - plug-and - battery LEDs power LED and it flashes orange

    I have a Satellite L455, which worked perfectly for more than six months now, but two weeks ago he began to behave strangely.

    I turned off the machine normally in the evening I was going to sleep. In the morning when I turned on it it turned on, HARD drive and on power LED blinked blue for a few seconds then they are gone. Machine does not start. I tried to turn it on again and it does the same thing. Then I saw the "power plug on" and "battery on" LED flashes orange at the same time. I unplugged the power adapter. Both lights were continuous blinking but machine will not feed. I removed the battery for a piece of 5 minutes, then reinserted it and the machine has worked all day.

    I went he deleted off the power plug and the morning again it wouldn't start until the when I removed the battery for a few minutes then it works again. The battery recharges very well that when I remove and reinsert it even without connecting the power cable still lights up and works perfectly.

    Then, I removed the battery and the power supply Plug and you press the power button for 30 seconds to unload the machine and then return power and battery and it worked until I turned off again and shutting off the power and then it didn't once again.

    If I stop just of machine and do not turn off the power cord, then I can turn it back on to and work with the machine without hassle even for three days without interruption.

    What could be wrong? Any help will be really appreciated.

    Concerning
    Yusuf

    Hi chidzungo,

    It must certainly be a hardware malfunction but he s strange why it pops up every day after you have closed the laptop. Do you use batteries and AC/DC to original Toshiba adapter? Have you connected external devices to your laptop? If so delete them before you turn on your laptop.

    What version of BIOS is installed at the moment? You should look on the Web from Toshiba website for an update. Update of the BIOS might also help and it s worth a try.

    Before you start reading the BIOS BIOS update instructions update [HERE: http://forums.computers.toshiba-europe.com/forums/ann.jspa?annID=60]

    Satellite L455 seems to be an American model, so the BIOS update can be downloaded from the Toshiba U.S. page but first check the exact part number:
    http://www.CSD.Toshiba.com/

  • After you download the security update 2015-008 I lost the function of the function keys and some other functions. Have already played with the keyboard f nothing helps. Are also past system on and outside...

    After you download the security update 2015-008 I lost the function of the function keys and some other functions. Have already played with the keyboard f nothing helps. Are also past system on and outside... need help pls

    PS noticed the update downloaded twice

    disregard my previous question... I found the answer: F1, F2 has been ticked on.

  • My function keys and volume controls will no longer work. Help.

    I'm unable to use my function keys and my volume level is not displayed on the screen as before.  I think that maybe the software controlling the function keys and volume control screen is damaged or not loading.  HELP please.

    Hello

    Download and install HP Quick Launch Buttons on the link below.

    FTP://ftp.HP.com/pub/SoftPaq/sp49001-49500/sp49104.exe

    Once the installation is complete, restart the laptop.

    OSD volume is provided by HP MediaSmart SmartMenu, so if you still don't see display, try the method in the link below and use Recovery Manager to reinstall this app - NOTE: you need at least one other application MediaSmart must be already installed, IE HP MediaSmart DVD, before you reinstall the Menu Smart.

    http://support.HP.com/us-en/document/c01868333

    Kind regards

    DP - K

    

  • HP mini 1109tu does not illuminate and has its power led flashing

    Well I just got my Bill Mini of the day the following day and while they were inspecting it this morning the power led flashes and it won't turn (even on the battery mode).

    [IMG] http://i168.Photobucket.com/albums/u171/Arnaehl/img_96221_hp-1000.jpg [LINE]

    Will or may someone help me solve this. I can't bear to look at my dead minis.

    Thanks in advance.

    HP mini 1109tu

    Hello

    Arnaehl wrote:

    Well I just got my Bill Mini of the day the following day and while they were inspecting it this morning the power led flashes and it won't turn (even on the battery mode).

    [IMG] http://i168.Photobucket.com/albums/u171/Arnaehl/img_96221_hp-1000.jpg [LINE]

    Will or may someone help me solve this. I can't bear to look at my dead minis.

    Thanks in advance.

    Try a hard reset.

    Disconnect the electric plug. Remove the battery.

    Press and hold the power button for 15 seconds.

    release the power button.

    Plug the AC adapter.

    Press the power button.

    Best regards
    ERICO

  • Cannot find the prototype of the function DeleteLinesFromFile and InsertlinesInFile

    Hello

    I want to remove or insert a line in a file. I want to use the function 'InsertlinesInFile' and 'DeleteLinesFromFile '. but I did not find the library to declare the prototype.

    Anyone know the library include what I need to use this function or other solutions to my problems.

    Thank you for your response.

    Stéphane SQUARE

    Hello Stéphane!

    Functions are from Server ActiveX LabWindows/CVI Interface: http://zone.ni.com/reference/en-XX/help/370051Y-01/cvi/usermanual/actxappdeletelinesfromfile/

    You can see the \activex\cvi\cvidemo.prj sample project to see how it is used.

    -Johannes

  • The WRT54G and DC input power versions.

    OK, I have many, many models and versions.  I have a WRT54G v1, V1.1, V2... V8, I also of the WRT54GS WRT54GL and others, many other things of Linksys, almost everything in the blue and black of varying sizes boxes.

    I have a devil of a time when I reconfigure my network or the woman changes the furniture.  I'd like a single document that lists power specifications and the requirements of adapter for devices of Athens... I can't find them anywhere on Linksys website.  I've searched and searched and nowhere can I find a list of consolidate.  I searched the forums and found many individual inscriptions, but it is a pain.

    Someone at - it a list of the power DC specifications, sizes of barrel and other things necessary to buy a replacement power adapter.

    This http://en.wikipedia.org/wiki/Linksys_WRT54G_series page lists a lot of information but does not list this critical information...  If someone send me the list, I'll try to get it posted it.  I'm amazed that Linksys does not listed it some here.  Lose a wall wart should not be a reason to pull you hair, just a simple purchase, if they do not want their stock, then at least tell us what they are.

    And Yes, I lost almost all the manuals...

    -jeff

    Well it is not possible to find the specification of power supply for all cards in a single list. You must manually locate each model number of your router and check their record and note the power adapter specification.

  • Dell 11 7140 place - do not start after reboot and shutdown without power connected

    Hi all

    I had problems with my new Dell 11 7140 place since I bought it. If I reboot or shutdown the Tablet without the power cable plugged in, it crashes on start/stop to a black looking screen as he stopped (but it isn't). He will sit on this State forever or until the battery is completely discharged. If I press and hold the power button for 5-10 seconds I can force a shutdown and turn off the tablet.

    It's even worse if; After that I have to reboot the machine, it just sits there on the circle of rotation points and never goes anywhere. After a few tries, it will eventually in windows recovery, but he never manages to recover anything. The only way to get the Tablet working again is to reimage the dos operating system.

    I tried the following:

    1. Most recent of the installed BIOS A07
    2. All the latest pages Dell device drivers
    3. The latest version of Windows Update
    4. I tried to start in safe mode, but get points again spinning
    5. Tried to restore points that had once or twice the PC to start again, but the system is messed up. Built in Windows apps like photo viewer don't work anymore and I just to reimage.
    6. Tried running the Dell diagnostics, but which did not find anything wrong

    The funny thing is that if I reboot or shutdown with the power connected, then everything is OK. I can do this all day with no problems. Standby and hibernation work OK with no power attached.

    I have tried everything I can, but I'm at a stage where he's going to have to go back to Dell. Please can anyone give me any suggestions of what I can try, thank you.

    To follow up on this post, the final solution to this issue was to return to the Dell Tablet. The motherboard has been replaced under warranty and since it was returned to me I have had no more problems.

  • Is it possible to hide a conditional function in responsibility. Say it together a small number of users, I need the function display and for some users, it must be hidden.

    Is it possible to hide a conditional function in responsibility. Say it together a small number of users, I need the function display and for some users, it must be hidden.

    Hello

    The normal thing to do is to create a similar additional responsibility and using Exclusions to 'hide' the features you want.

    Then assign it to restricted users.

    Kind regards

    Bashar

  • Deleted snapshots and VM used power over

    Hello

    I am dealing with a virtual server, which is no longer in production, but has a few important files that a user needs. Since this server was no longer required, it is stop and a few pictures removed to give room for other servers in comments. Unfortunately the last good backup of this server has been lost and can not power on this server as error readings

    Cannot open disk ' / vmfs/volumes/4d81fa10-7b05d3b6-6163-842b2b7839b3/xxxxx/xxxxxx000001.vmdk' or one of the snapshot disks it depends on.

    VMware ESX can not find the virtual disk 'xxxxx.vmdk '. Check that the path is valid and try again.

    When I check the data store for the vmdk listed in the properties of the vm under hard drive, each of them exists, with the exception detailed in error, which is a snapshot

    I came across this VMware & amp; #8220; Cannot open the disk & amp; #8216; XXXXXX.vmdk & amp; #8217; or one of the snapshot disks depends on. & amp...

    cannot know what exactly to do to get the server online.

    Also I see options to mount the vmdk on a desktop and extract the files. : virtual drive to mount VMware (VMDK file) in the physical machine:

    How does the work above, still need to mount snapshots? all I need is a bunch restored from files do not need the server. Please guide im a beginner for vmware.

    The easiest way to access the files and could be to use disk utility mount VMware virtual disk Development Kit. This allows you to mount the virtual drive - 1pc_aims_4 - 000001.vmdk in this case - to your local operating system and extract the files you need. You can even mount the virtual disk in read-only mode to ensure integrity.

    André

  • Hello.. I'm from the programming, but new to actionscript. I would like to ask if there was a library where all built in functions, methods, and events can be searched. As for VB, MSDN (of Microsoft Developer Network) used to be there. More than once it h

    Hello.. I'm from the programming, but new to actionscript. I would like to ask if there was a library where all built in functions, methods, and events can be searched. As for VB, MSDN (of Microsoft Developer Network) used to be there. More than once it happens that I write a few lines of code, but a built-in function already exists for the same thing. Is there a way to check it out ahead of time?

    An online resource are QAnywhere® to Adobe ActionScript 3 (AS3)

  • I was in Lightroom and had a power surge and now Lightroom will not... What can I do about it?

    I was in Lightroom and had a power surge and now Lightroom will not launch. He has encountered an error when reading the preview cache and needs to stop smoking. Lightroom will attempt to fix the next time it starts. I closed my system and Lightroom will not always start. Does anyone have any suggestions?

    You bet and Yes:

    * do not delete entire .lrdata folder

    * don't delete anything else

    Best?

    If so, you can rebuild strength previews (e.g. standard previews of entire catalog) using library-> menu previews.

    Rob

Maybe you are looking for

  • I forgot my administrator password, I have no disc reset

    I forgot my administrator password, I have no disc reset and I tried using the startup disk command prompt to unlock the secret admin account and he told me the job was filled with sucuessfully, but I cannot yet connect as an administor. I have also

  • 2 Smartband does not connect after the software update

    Hello So I upgraded my Xperia Z5 yesterday and now my Smartband connects. I've seen some other posts on this topic and I've tried everything mentioned there, but it still does not work. I tried to activate my Bluetooth and NFC and turn it on again an

  • my icons all all the open program in a program/windo

    If itry to openwith any program as all the icons are now even he doesnot open if I open with any media, all the icons are of same media now all the icons are same I open any program location Moose because all the shortcuts are the same, please help

  • Listeners of bean not invoked in the Facelets page fragment in Jdeveloper 12 c

    Hi allI'm working on an ADF application and facing the issue, as described below.I created a facelets page, index.jsf. In the jsf page, I added a taskflow bounded as a region.The taskflow, MainTF.xml, is based on fragments of the page. The default ac

  • Product licenses Creative cloud on a shared computer

    I have a computer in my company that is used in a room photo.  This computer is used by 3 to 5 people to take pictures and we must change these photos using Photoshop.  How can I get a license on this shared computer now that Photoshop is not availab