Jump to content

Recommended Posts

First post here http://www.phpfreaks.com/forums/index.php/topic,246962.0.html

 

but been told to try and ask on this board as TOPN is a MSSQL command.

 

I have written the following query that returns the top 10 items from a column. I am looking to change this to give me the top 10 Percentage from the same column but dont know how to change my query. Could somebody please help.

 

The following is my query:

 

SELECT "TEST AHT By Agent".RootirID saw_0, "TEST RE Values Dim"."Queue Name" 
saw_1, "TEST AHT By Agent"."Agent ID" saw_2, "TEST AHT By Agent"."AHT -OM" 
saw_3 FROM Genesys_TEST WHERE ("TEST RE Values Dim"."Queue Name" LIKE 'Queue 1
') AND (TOPN("TEST AHT By Agent"."AHT -OM", 10) <= 10) ORDER BY saw_0, 
saw_1, saw_2

 

Currently within my query I have the following:

 

Code: [select]AND (TOPN("TEST AHT By Agent"."AHT -OM", 10) <= 10)

which gives me the top 10 values within the TEST AHT By Agent column.

 

What i would like is for it to give me the top 10% which would mean it gives me a total of 6 values as the total entries within the TEST AHT By Agent column is 56.

 

Hope that makes sense. Thanks in advance.

Link to comment
https://forums.phpfreaks.com/topic/153163-topn-command/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.