Avg/sum/min/max/count
Is there anyway to see the avg/sum/min/max/count when you highlight a bunch of cells? I can't figure out if iPad numbers has this function. I've read several articles that mention it.
Also, I am having trouble with some formulas, does anyone know where I might get help on that?
Download *_Numbers User Guide_* and *_iWork Formulas and Functions User Guide_*
You may do that from the Help menu of the version running on a mac.
You may also download them thru :
http://support.apple.com/en_US/manuals/#iwork
You will be able to select the language used.
I don't know if there are guides specific to the ipad versions.
Yvan KOENIG (VALLAURIS, France) samedi 15 mai 2010 16:39:57
Similar Messages
-
Pivot min & max in single row.
Greetings,
Please help me in this case...
Can we get the columns as,
Dimension, # Count, MAX (# Count), MIN (#Count) all in one line with separate values but separate min, max & count in pivot.
also imagine for multiple rows .
this report is seen on year level but the min & max shld be on a level below, quarter.
i.e. this report will give the total count for all quarters, max no of count from 4 quarters & same for min.
---------|_--____________YEAR_____________
Dim ---|# Count -- MAX (Count) --- MIN (Count)
Please help.
Thanks,
DevI'm not sure if this is what you're after, but using Aketi's tabibitosan method:
with results as (select someid,
adate,
row_number() over (order by adate) rn,
dense_rank() over (partition by someid order by adate) dr,
row_number() over (order by adate) - dense_rank() over (partition by someid order by adate) diff
from t1)
select someid,
min(adate) min_adate,
max(adate) max_adate
from results
group by someid, diff
order by min(adate);
SOMEID MIN_ADATE MAX_ADATE
756 25/01/2010 07:22:57.000000 25/01/2010 07:23:58.000000
822 25/01/2010 07:24:44.000000 25/01/2010 07:25:33.000000
770 25/01/2010 07:29:53.000000 25/01/2010 07:30:11.000000
816 25/01/2010 08:03:02.000000 25/01/2010 08:27:13.000000
770 25/01/2010 08:54:04.000000 25/01/2010 08:54:16.000000
822 25/01/2010 08:58:07.000000 25/01/2010 08:58:09.000000 -
Pivot view - how to find min & max on a level lower than selected..
Hi all,
we have a pivot view having structure.
Year
Dept |Count| Min | MAX |
ABC | 87 | | |
XYZ | 44 | | |
Can we find out the min & max in the current year selected on quarter level & not on year and no show quarter on report. I.e the min count & max value of count in the 4 quarters.
also for below structure.
Year
| Q1 | Q2 | Q3 | Q4 |
Dept |Count| Min | MAX |Count| Min | MAX |Count| Min |MAX | Count| Min | MAX|
ABC | | | | | | | | | | | | |
XYZ | | | | | | | | | | | | |
similarly find on quarter & for quarter we want the min & max on month level. i.e minimum & max in 3 months under that quarter.
If we set the aggregation level as Min in max in pivot itself it shows the min & max same as the count as it calculates on the year level.
Thanks,
DevUsing hierarchies with exception aggregation can give strange results when aggregating to the parent nodes of the hierarchy. Recommendations:
1) check whether the results are still wrong if you deactivate the hierarchy view
2) build you exception aggregations globally. That is, do not define the exception aggregation in the structure of your query. Build it as a CKF on your InfoProvider.
3) if the above steps don't work, perhaps you can use APD or get the exception aggregations calculated in the load to the InfoProvider rather than in BEx -
How to get min,max,avg time for query execution?
Dear Friends,
In AWR we are getting avg time taken to execute particular query, how can one get min,max time taken by query during number of executions.
ThanksI would run the sql in a cursor for loop, to get a quite reasonable execution time without changing the actual execution plan:
SQL> show user;
USER is "HR"
SQL> set timing on
SQL> select count(*) from all_objects;
COUNT(*)
55565
Elapsed: 00:00:03.91
SQL> var p_sql varchar2(200)
SQL> exec :p_sql := 'select * from all_objects'
PL/SQL procedure successfully completed.
Elapsed: 00:00:00.00
SQL> declare
2 t1 timestamp := systimestamp;
3 begin
4 execute immediate 'begin for c in (' || :p_sql || ') loop null; end loop; end;';
5 dbms_output.put_line('Elapsed: ' || (systimestamp - t1));
6 end;
7 /
PL/SQL procedure successfully completed.
Elapsed: 00:00:03.53
SQL> declare
2 t1 timestamp := systimestamp;
3 begin
4 execute immediate 'begin for c in (' || :p_sql || ') loop null; end loop; end;';
5 dbms_output.put_line('Elapsed: ' || (systimestamp - t1));
6 end;
7 /
PL/SQL procedure successfully completed.
Elapsed: 00:00:02.75
SQL> declare
2 t1 timestamp := systimestamp;
3 begin
4 execute immediate 'begin for c in (' || :p_sql || ') loop null; end loop; end;';
5 dbms_output.put_line('Elapsed: ' || (systimestamp - t1));
6 end;
7 /
PL/SQL procedure successfully completed.
Elapsed: 00:00:02.73
SQL> declare
2 t1 timestamp := systimestamp;
3 begin
4 execute immediate 'begin for c in (' || :p_sql || ') loop null; end loop; end;';
5 dbms_output.put_line('Elapsed: ' || (systimestamp - t1));
6 end;
7 /
PL/SQL procedure successfully completed.
Elapsed: 00:00:02.66
SQL> ---- alter system flush shared_pool;
SQL> declare
2 t1 timestamp := systimestamp;
3 begin
4 execute immediate 'begin for c in (' || :p_sql || ') loop null; end loop; end;';
5 dbms_output.put_line('Elapsed: ' || (systimestamp - t1));
6 end;
7 /
PL/SQL procedure successfully completed.
Elapsed: 00:00:02.80
SQL> declare
2 t1 timestamp := systimestamp;
3 begin
4 execute immediate 'begin for c in (' || :p_sql || ') loop null; end loop; end;';
5 dbms_output.put_line('Elapsed: ' || (systimestamp - t1));
6 end;
7 /
PL/SQL procedure successfully completed.
Elapsed: 00:00:02.64
SQL>
https://forums.oracle.com/thread/705536?start=15&tstart=0
Regards
Girish Sharma -
Using sql functions (min, max, avg) on varray or table collection
Hi,
I would like to know if there is a way to use sql function or oracle sql function like Min,Max, Avg or percentile_cont on varray or table collection ?
Does anyone encountered this type of problem ?
ThanksYes you can apply Min,Max, Avg... if varray or table collection type is SQL (created in the databaase) UDF, not PL/SQL declared type:
SQL> set serveroutput on
SQL> declare
2 type str_tbl_type is table of varchar2(4000);
3 str_tbl str_tbl_type := str_tbl_type('X','A','D','ZZZ');
4 max_val varchar2(4000);
5 begin
6 select max(column_value)
7 into max_val
8 from table(str_tbl);
9 dbms_output.put_line('Max value is "' || max_val || '"');
10 end;
11 /
from table(str_tbl);
ERROR at line 8:
ORA-06550: line 8, column 18:
PLS-00642: local collection types not allowed in SQL statements
ORA-06550: line 8, column 12:
PL/SQL: ORA-22905: cannot access rows from a non-nested table item
ORA-06550: line 6, column 5:
PL/SQL: SQL Statement ignored
SQL> create or replace type str_tbl_type is table of varchar2(4000);
2 /
Type created.
SQL> declare
2 str_tbl str_tbl_type := str_tbl_type('X','A','D','ZZZ');
3 max_val varchar2(4000);
4 begin
5 select max(column_value)
6 into max_val
7 from table(str_tbl);
8 dbms_output.put_line('Max value is "' || max_val || '"');
9 end;
10 /
Max value is "ZZZ"
PL/SQL procedure successfully completed.
SQL> SY. -
Max, Min and Count with Group By
Hello,
i want the max, min and count of a table, which is grouped by a column
I need a combination of these two selects:
select
max(COUNTRY_S) MAXVALUE,
min(COUNTRY_S) MINVALUE
from
tab_Country
select
count(*)
from
(select COUNTRY_TXT from tab_Country group by COUNTRY_TXT) ;
The result should be one row with the max and min value of the table and with the count of the grouped by table, not the max and min of each group! - i hope you understand my question?
Is this possible in one SQL-select?
Thank you very much
Best regards
HeidiHi, Heidi,
HeidiWeber wrote:
Hello,
i want the max, min and count of a table, which is grouped by a column
I need a combination of these two selects:
select
max(COUNTRY_S) MAXVALUE,
min(COUNTRY_S) MINVALUE
from
tab_Country
select
count(*)
from
(select COUNTRY_TXT from tab_Country group by COUNTRY_TXT) ;
The result should be one row with the max and min value of the table and with the count of the grouped by table, not the max and min of each group! - i hope you understand my question?
Is this possible in one SQL-select?
Thank you very much
Best regards
Heidi
It's not clear what you want. Perhaps
SELECT MAX (country_s) AS max_country_s
, MIN (country_s) AS min_country_s
, COUNT (DISTINCT country_txt) AS count_country_txt
FROM tab_country
I hope this answers your question.
If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all the tables involved, and the results you want from that data.
Explain, using specific examples, how you get those results from that data.
Always say what version of Oracle you're using (e.g. 11.2.0.2.0).
See the forum FAQ: https://forums.oracle.com/message/9362002 -
How to dynamically set Min count and Max Count values in Adobe Print Form?
How to set the Min Count and Max Count values dynamically in a Print Form?
The values when set should over ride the values set in Binding Tab.
This is all needed to print multiple Material Number labels on a single page - and the number of labels to be printed needs to be under user control - something like an Avery Address labels
Please advise.
Thanks,Here is a work around that works for me and may not be an intelligent solution .
I kept the Min Count to 1 on the subform binding properties.
Per the number of labels required, I appended the same item to the internal table so many times and passed it to the label.
it works fine for my requirement.
However - leaving out the post for a while to see if this can be done at the form level via scripting.
Thanks, -
Combine seperate lookupsets - find max(), count()?
Hello, my knowledge of SSRS is intermediate. Enough to have a plan. But I need just a little assistance.
Here are the functions.
here are my three lookupsets:
-LookupSet(Fields!name.Value, Fields!name.Value, Fields!act_actualend.Value, “AccountActivities”)
-LookupSet(Fields!name.Value, Fields!name.Value, Fields!act_actualend.Value, “AccountContactActivities”)
-LookupSet(Fields!name.Value, Fields!name.Value, Fields!act_actualend.Value, “AccountOpportunityActivities”)
1) How could I find the 'Max()' of all three of these datasets. The single highest number.
2) How could I find the 'COUNT()' of all three of these datasets. The total number of rows.
If they can be done separately and then added together using variables, that is an acceptable solution. Still, I'm just learning syntax here.
THanksHi ebs_software,
According to your description, you used three lookupset function to retrieve data from other dataset, now you want to select max value and count of values of all three datasets.
I tested the issue in my local machine, we could not select sum and max value returned by lookupset function directly. To workaround this issue, we need to use custom code. For detail information, please refer to the following document:
1. Right-click outside of the report, click Report Properties.
2. Click Code in left pane, type the code like below:
Public Function AggLookup(ByVal choice as String, ByVal items as Object)
If items is Nothing then
Return Nothing
End If
Dim current as Decimal
Dim sum as Decimal
Dim count as Integer
Dim min as Decimal
Dim max as Decimal
Dim err as String
current = 0
sum = 0
count = 0
err = ""
For each item as Object in items
'Calculate count
count += 1
'Check value is a number
If IsNumeric(item) then
'Set current
current = Convert.ToDecimal(item)
'Calculate sum
sum += current
'Calculate min
If min = Nothing then
min = current
End If
If Min >current then
min = current
End If
'Calculate max
If max = Nothing then
max = current
End If
If max < current then
max = current
End If
'Return NaN if value is not a number
Else
err = "NaN"
End If
Next
'Select and set output based on the user choice or choice passed by function
If err = "NaN" then
If choice = "count" then
Return count
Else
Return err
End If
Else
Select Case choice
Case "sum"
Return sum
Case "count"
Return count
Case "min"
Return min
Case "max"
Return max
Case "avg"
'Calculate the average avoiding divide by zero errors
If count > 0 then
Return sum / count
Else
Return 0
End If
End Select
End If
End Function
3. Right-click handle of the column you want to count values returned by lookupset function, click Expression.
4. In Expression text box, type the expression like below:
=LookupSet(Fields!name.Value, Fields!name.Value, Fields!act_actualend.Value,"AccountActivities").Length + LookupSet(Fields!name.Value, Fields!name.Value, Fields!act_actualend.Value,"AccountContactActivities").Length + LookupSet(Fields!name.Value, Fields!name.Value, Fields!act_actualend.Value,"AccountOpportunityActivities").Length
5. Right-click handle of the column you want to calculate total of values returned by lookupset function, click Expression.
6. In Expression text box, type the expression like below:
=Code.AggLookup("sum",LookupSet(Fields!name.Value, Fields!name.Value, Fields!act_actualend.Value,"AccountActivities"))
7. Right-click handle of the column you want to select max value returned by lookupset function, click Expression.
8. In Expression text box, type the expression like below:
=Code.AggLookup("max",LookupSet(Fields!name.Value, Fields!name.Value, Fields!act_actualend.Value,"AccountActivities"))
The following screenshot is for your reference:
If you have any more questions, please feel free to ask.
Thanks,
Wendy Fu
If you have any feedback on our support, please click
here.
Wendy Fu
TechNet Community Support -
What is the max. count of internal worker-threads in B1iSN 88?
Hi Experts,
We have an installation of B1iSN 88 with an ECC 6.0 and 54 SAP Business One installation. The Hardware is 8 Core multi-threads processor. 32GB Memory. Now we have a problem with the queuing of Events. What we have found is that the configuration of the internal worker-threads is set to -1(please see below for the settings). We change the settings to xcl.threads=20 and it improves the queuing. My question is what is the max. count of internal worker-threads per core? so that we can know how many worker will set and if we need to upgrade the CPU to 16 Core..
# The max. count of internal worker-threads afforded for the internal Scheduler (defaults to 1)
# The value of 0 means that there is no limit (what in general should not be set up).
# A negative value means the count of threads per available processor
xcl.threads=-1
Regards,
WilsonYou're very welcome.
Yes, they are very nice machines.
What a jump in performance when I swapped out the Pentium 4 620 mine had, for the PD 945, and tossed in 4 GB of memory.
That box will also run the Radeon HD 6570 with no problem too, which is what I put in mine.
The downside of that model is that there are no settings for ahci or raid.
I own or have owned every CMT since the d510 with the exception of the dc7900.
My main PC is now the 8200 Elite CMT which I installed W8.1 on.
It has an i7-2600 processor and 32 GB of memory, 1 TB SATA III hard drive.
I threw in a Radeon HD 6670 in that one.
Best Regards,
Paul -
Min max with Alpha Beta pruning
Hey I would like to add Min max with Alpha - Beta pruning for my tic tac toe game. If you know some sort of tutorial or anything please let me know. After I complete I'm going to make a complete guide to make a Tic Tac Toe game with a really nice GUI, Music, AI, and Network capabilities. I have the game made so far. I'm going to rewrite it with interfaces and clean up the code a lot then create the guide, but before I do all this I want to create and AI for it.
I suppose that since, other than reading a summary on Wikipedia, I
don't know what a 'minimax algorithm' is and have never tried to
implement one I should not make fun.The idea is quite simple: your best move e.g. in a board game is my worst
result and vice versa. If I can minimize your best move I have maximized
my best move (and that's the move I'll play).
Now suppose my best move somewhere in that game tree turns out
to be worse than another best move of mine somewhere else in that
same tree, there is no need anymore for me to explore the rest of that
subtree. That's the alpha pruning part. The same counts for you and
that's the beta pruning part.
alpha-beta pruning reduces the number of nodes to be examined to
O(sqrt(n)) where n are all the nodes in the fully examined tree. It is
quite a nice algorithm although quite tricky too when you have to build it.
The best reference I can think of now is the old book "Data Structures"
by Horrowitz and Sahni.
kind regards,
Jos -
Min-Max Planning simple questions
Hi
I'm trying to use Min-Max Planning. Inventory User's Guide says that Min-Max Plannig uses a demand to evaluate order quantity, but don't tell if such demand by month, year or whatever. Looking the figures seems to be annual demand (but doesn't match my annual sales). What kind of demand is used?
If demand is calculated on a yearly basis, resulting order qty should be to satisfy sales of a whole year (I guess).
Is there a way to change that? Does really matter?
Please some words of advise
OscarOPR wrote:
Hi
I'm trying to use Min-Max Planning. Inventory User's Guide says that Min-Max Plannig uses a demand to evaluate order quantity, but don't tell if such demand by month, year or whatever. Looking the figures seems to be annual demand (but doesn't match my annual sales). What kind of demand is used?Hi Oscar,
depending upon at which level (organization or subinventory) you are running Min-Max planning and the options selected for net demand will determine what will be included under open demand. It is the total open demand on or before the demand cutoff date, based on net demand selection for reserved & unreserved orders and WIP. It is NOT by month, year or any period.
Min-Max at Organization level:
If you choose Yes for Net Unreserved Orders, Net Reserved Orders and Net WIP Demand then Open Demand is the sum of unreserved sales orders, inventory reservations (including reserved sales orders), account issue move orders, and WIP component demand scheduled for issue on or before the demand cutoff date.
Min-Max at Subinventory level:
If you choose Yes for Net Unreserved Orders and Net Reserved Orders (no WIP demand option here) then Open Demand is the sum of inventory reservations (including reserved sales orders), account issue move orders, and subinventory transfer move orders scheduled for issue from this subinventory on or before the demand cutoff
date. At subinventory level inventory reservations referencing a different subinventory, or with no subinventory specified, are not included.
e.g. if the demand cutoff date is 30-Jun-2009 and net options have been selected as Yes then then it will look for demand upto 30-Jun-2009 (Note: some apps reports have time part issue while comparing dates, so in those cases 30-Jun-2009 is taken as 30-Jun-2009 00:00:00 i.e 29-Jun-2009 midnight!).
Also if you specify a past date for demand cutoff date it will consider open demands available, if any, upto that past date (but you plan for the future, not past). -
Post Author: RobCote
CA Forum: Formula
Any ideas why the Sum/Ag/Max functions would be returning the count of a row that has a decimal in the Field I'm trying to sum?Post Author: V361
CA Forum: Formula
does cr think the field is text ?, if so, you may need to use a formula to convert to a number, and then sum off the formula. -
Please take a look at my code:
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.text.DecimalFormat;
import java.text.NumberFormat;
public class StatisticGui extends JApplet
private JButton push;
private JButton calc;
private JTextField tf;
private JTextArea ta;
int push1,push2;
int sum=0,value,sum1=0;
int min,max,range,again;
double average;
double stad,stad1,pass;
public void init()
push1=0;
push=new JButton("Enter Num");
push.addActionListener(new button1());
calc=new JButton("Calc Stats");
calc.addActionListener(new button2());
tf=new JTextField(10);
ta=new JTextArea(16,20);
Container cp=getContentPane();
cp.setBackground(Color.gray);
cp.setLayout(new FlowLayout());
cp.add(tf,BorderLayout.WEST);
cp.add(push,BorderLayout.CENTER);
cp.add(calc,BorderLayout.CENTER);
cp.add(ta,BorderLayout.CENTER);
setSize (400,300);
private class button1 implements ActionListener
public void actionPerformed(ActionEvent event)
String text=tf.getText();
value=Integer.parseInt(text);
min=max=value;
if(value>=0)
push1++;
sum+=value;
sum1+=Math.pow(value,2);
if(value>=50)
push2++;
max = Math.max(max, value);
min = Math.min(min, value);
if(value<0)
do
again=JOptionPane.showConfirmDialog(null,"Invalid Number,Please enter again!");
while(again==JOptionPane.NO_OPTION);
average=(double)sum/push1;
pass= (double)push2 / push1;
stad = sum1/push1 - Math.pow(average,2);
stad1=Math.sqrt(stad);
range=max-min;
private class button2 implements ActionListener
public void actionPerformed(ActionEvent event)
DecimalFormat fmt=new DecimalFormat("0.##");
NumberFormat percent=NumberFormat.getPercentInstance();
ta.append("\nMean:" + fmt.format(average));
ta.append("\nStandDev:" + fmt.format(stad1));
ta.append("\nRange:" +min);
ta.append("\nPercentPass:" + percent.format(pass));
not thing wrong with my code but, i can not find the value of min and max, please help!String text=tf.getText();
value=Integer.parseInt(text);
min=max=value;So your ''max' and 'min' will be set to 'value' ...
>
if(value>=0)
push1++;
sum+=value;
sum1+=Math.pow(value,2);
if(value>=50)
push2++;
max = Math.max(max, value);
min = Math.min(min, value);And now 'min' and 'max' are calcuelated from in effect
max = Math.max(value, value);
min = Math.min(value, value);
because you have previously set 'min' and 'max' to 'value'.
not thing wrong with my code but, i can not find the
value of min and max, please help!I agree, there is nothing wrong with your code (if you want 'min' and 'max' to be the last values you supplied)! -
Want to set Min Max for a material for PD MRP type
Hi,
I know Maximum stock level field in Material master MRP 2 view ? but where do i maintain minimum stock level? not procured?
My client wants to set up his inventory with Min Max levels using MRP PD?
Thanks and Apprecaites help.
Regards,
SivaHi,
If you want to maintain a Max and Min stock level, Maximum stock is shown straight away, you cannot find the Minimum field directly.
if you want to use MRP type PD then go for safety stock that will be your minimum stock level
or else use Re-order point planning, re-order point will be your minimum and Max-level as maximum.
Thanks
Satya -
How to Get the min,max and original values in a single query
Hi,
I have a task where in i have to the min , max and the original values of a data set .
I have the data like below and i want the target as well as mentioned below
SOURCE
DATASOURCE
INTEGRATIONID
SLOT_DATE
SLOT1
SLOT2
SLOT3
SLOT4
SLOT5
SLOT6
SLOT7
SLOT8
SLOT9
SLOT10
1
101
201111
100
100
200
100
100
100
300
300
300
300
1
101
2011112
200
200
200
200
100
100
100
100
200
300
TARGET
DATASOURCE
INTEGRATIONID
SLOT_DATE
SLOT_VALUE
SLOT MIN
SLOT_MAX
SLOT NUMBER
1
101
201111
100
1
2
SLOT1
1
101
201111
100
1
2
SLOT2
1
101
201111
200
3
3
SLOT3
1
101
201111
100
4
6
SLOT4
1
101
201111
100
4
6
SLOT5
1
101
201111
100
4
6
SLOT6
1
101
201111
300
7
10
SLOT7
1
101
201111
300
7
10
SLOT8
1
101
201111
300
7
10
SLOT9
1
101
201111
300
7
10
SLOT10
1
101
2011112
200
1
4
SLOT1
1
101
2011112
200
1
4
SLOT2
1
101
2011112
200
1
4
SLOT3
1
101
2011112
200
1
4
SLOT4
1
101
2011112
100
5
8
SLOT5
1
101
2011112
100
5
8
SLOT6
1
101
2011112
100
5
8
SLOT7
1
101
2011112
100
5
8
SLOT8
1
101
2011112
200
9
9
SLOT9
1
101
2011112
300
10
10
SLOT10
e
so basically i would first denormalize the data using the pivot column and then use min and max to get the slot_start and slot_end.
But then i
can get the min and max ... but not the orignal values as well.
Any thoughts would be appreciated.
ThanksIf you want to end up with one row per slot per datasource etc, and you want the min and max slots that have the same value as the current slot, then you probably need to be using analytic functions, like:
with t as
(SELECT 1 datasource,101 INTEGRATIONID, 201111 slotdate, 100 SLOT1, 100 SLOT2, 200 slot3, 100 slot4, 100 slot5, 100 slot6, 300 slot7, 300 slot8, 300 slot9, 300 slot10 FROM DUAL union all
SELECT 1, 101, 2011112, 200, 200, 200, 200, 100, 100, 100, 100, 200, 300 FROM DUAL),
UNPIVOTED AS
(SELECT DATASOURCE,INTEGRATIONID,SLOTDATE,1 SLOT,SLOT1 SLOT_VALUE
FROM T
UNION ALL
SELECT DATASOURCE,INTEGRATIONID,SLOTDATE,2 SLOT,SLOT2
FROM T
UNION ALL
SELECT DATASOURCE,INTEGRATIONID,SLOTDATE,3 SLOT,SLOT3
FROM T
UNION ALL
SELECT DATASOURCE,INTEGRATIONID,SLOTDATE,4 SLOT,SLOT4
FROM T
UNION ALL
SELECT DATASOURCE,INTEGRATIONID,SLOTDATE,5 SLOT,SLOT5
FROM T
UNION ALL
SELECT DATASOURCE,INTEGRATIONID,SLOTDATE,6 SLOT,SLOT6
FROM T
UNION ALL
SELECT DATASOURCE,INTEGRATIONID,SLOTDATE,7 SLOT,SLOT7
FROM T
UNION ALL
SELECT DATASOURCE,INTEGRATIONID,SLOTDATE,8 SLOT,SLOT8
FROM T
UNION ALL
SELECT DATASOURCE,INTEGRATIONID,SLOTDATE,9 SLOT,SLOT9
FROM T
UNION ALL
SELECT DATASOURCE,INTEGRATIONID,SLOTDATE,10 SLOT,SLOT10
FROM T)
select DATASOURCE,INTEGRATIONID,SLOTDATE,slot,slot_value,min(slot) OVER (partition by datasource,integrationid,slotdate,rn) minslot,
max(slot) OVER (partition by datasource,integrationid,slotdate,rn) maxslot
FROM
select DATASOURCE,INTEGRATIONID,SLOTDATE,max(rn) over (partition by datasource,integrationid,slotdate order by slot) rn,slot,slot_value
FROM
(SELECT DATASOURCE,INTEGRATIONID,SLOTDATE,slot,slot_value,
case when row_number() over (partition by datasource,integrationid,slotdate order by slot) = 1 or
lag(slot_value) over (partition by datasource,integrationid,slotdate order by slot) <> slot_value
then row_number() over (partition by datasource,integrationid,slotdate order by slot)
ELSE null
END rn
from unpivoted
order by DATASOURCE,INTEGRATIONID,SLOTDATE,slot
Maybe you are looking for
-
I've been having massive issues copying mp4 video files onto my iPhone 4 from my windows 7 (64 bit) pc. I converted a large number of avi files into mp4 using aiseesoft movie converter and most of them work just fine. However about a quarter of the f
-
I cannot get photos placed in InDesign CS5 to show up only as grayscale/black. When a separation is done, part of the photos show up on both parts of the color separation. I've been hunting for a solution for hours. !
-
help me on joins , 1). What is joins? 2). Where it is used? 3). How it is used? 4). difference in them? please help me with example points will be awarded, thank you, Regards, Jagrut BharatKumar Shukla
-
I have downloaded and deleted an album 3 times now because on the playback, every 30-60 secs. it jumps to another song on the album. I have never had this problem before. Thanks !
-
Where is the 512x512 image used? Do they put shine on it?
We're supposed to upload a 512x512 image... Do they put shine on the image? What if you've pre-rendered your own image? Anyone know? Many thanks Cheers, Blaze.