How to get the max value of a set of percentage values?
Hi,
I've tried to get the max and min value of a set of calculated percentage values. Such as
Jan Feb March Apr May Jun Min Average Max
0,5 0,8 1,1 0,4 1 0,6 0,4 0,7 1,1
The average value works fine. But with "min" and "max" I have a problem.
I've tried to get the value with the following ways:
- Create a new calc. keyfigure and make a sum of all values: (Jan + Feb + ...) and set the calculation in key figure properties to Min/Max.
- Create a new calc. keyfigure and make a sum of all values and set the aggregation to Min/Max
- Create a selected keyfigure with a filter to the necessary periods and set a calculation to Min (Aggregation is not possible here)
- Create a new cal. keyfigure with all periods and the function Min. e.g. min(Jan, (min Feb, (min (....)
None of this solutions provides the right min and max value. When I use an amount value (e.g. Euro) instead of these percentage values the keyfigure with the min and max function works. The others all provide wrong values.
Is there a solution to get the right min and max value???
It would be a great help when you have any hints.
Thanks
Claudia
Hi Aduri,
thanks for your answer but your solution doesn't work.
The problem is that the periods are defined in a structure with offsets such as
- period-11
- period-10
- period
in this structure elements there is also the keyfigure "netvalue" defined.
In the rows of the report there is another characteristic such as company code.
Is there a solution to find the max and min values of the period values for each company code? Or must I change the data model e.g. copy the keyfigure and make a new keyfigure with another aggregation level?
Thanks for any hints!
Claudia
Similar Messages
-
How to get the max(level)?
Hi,
The below query returns level and other selected columns.
I need to get the max(level) 2nd column value in the below example.How to modify the query?
Ex
Level max(level) id
1 5 101
1 5 102
1 5 103
2 5 104
2 5 105
3 5 107
4 5 120
5 5 134
5 5 280
SELECT DISTINCT level lvl
,form_frms.emp_id
,form_frms.ing_emp_id
,form_frms.prve_id
,CASE
WHEN (select div_dn
from epm_prod epm
where epm.emp_id= form_frms.ing_emp_id) ='Y' THEN DIV_DN
WHEN NVL((select distinct 'N'
from emp_pro_version prvv
where prvv.is_py='Y' and
prvv.IS_VERSION ='N' and
prvv.emp_id=form_frms.ing_emp_id) ,'Y')='N'
THEN 'Y'
WHEN NVL((select distinct 'Y'
from employee epm
where emp.emp_id=form_frms.ing_emp_id
and epm.status<>'NEW') ,'N') ='Y'
THEN 'Y'
ELSE 'N'
END
ELSE 'N'
END UN_KNOWN_ID
FROM (SELECT empvv1.prvv_id
FROM emp_view_version empvv1
WHERE empvv1.is_version = 'Y'
) form_frms
START WITH form_frms.emp_id = :lv_emp_id
CONNECT BY PRIOR form_frms.ing_emp_id = form_frms.emp_id
ORDER BY level DESC, form_frms.emp_id,UNKNOWN_ID ASC;
Edited by: shivasha on Feb 9, 2013 12:24 AMMaybe
select lvl,
max(lvl) over (order by null rows between unbounded preceding and unbounded following) max_level,
emp_id,
unknown_id
from (SELECT DISTINCT
level lvl,
form_frms.emp_id,
form_frms.ing_emp_id,
form_frms.prve_id,
CASE WHEN (select div_dn
from epm_prod epm
where epm.emp_id = form_frms.ing_emp_id
) = 'Y'
THEN DIV_DN
WHEN NVL((select distinct 'N'
from emp_pro_version prvv
where prvv.is_py = 'Y'
and prvv.IS_VERSION = 'N'
and prvv.emp_id=form_frms.ing_emp_id
),'Y'
) = 'N'
THEN 'Y'
WHEN NVL((select distinct 'Y'
from employee epm
where emp.emp_id = form_frms.ing_emp_id
and epm.status != 'NEW'
),'N'
) = 'Y'
THEN 'Y'
ELSE 'N'
END UNKNOWN_ID
FROM (SELECT empvv1.prvv_id
FROM emp_view_version empvv1
WHERE empvv1.is_version = 'Y'
) form_frms
START WITH form_frms.emp_id = :lv_emp_id
CONNECT BY PRIOR form_frms.ing_emp_id = form_frms.emp_id
ORDER BY lvl DESC,emp_id,UNKNOWN_IDRegards
Etbin -
how to get the record with the max sequence no
table as
seq student mark
1 A 10
2 A 15
1 B 20
2 B 10
1 C 30
here is what i need
seq student mark
2 A 15
2 B 10
1 C 30i have used your query + some decode
With t As
Select 'A' st, 'X' Type, 1 seq, 001 marker_no, 10 mark From dual Union All
Select 'A', 'X', 2, 001, 12 From dual Union All
Select 'B', 'X', 1, 002, 10 From dual Union All
Select 'B', 'X', 2, 003, 12 From dual Union All
Select 'B', 'X', 3, 003, 15 From dual Union All
Select 'C', 'X', 1, 001, 10 From dual Union All
Select 'C', 'X', 2, 002, 15 From dual Union All
Select 'C', 'Y', 3, 001, 20 From dual Union All
Select 'C', 'Y', 4, 001, 10 From dual
Select st,
Sum (x_cnt) x_cnt,
Max (x_seq) Keep (dense_rank Last Order By x_seq) x_seq,
max(x_marker_no) keep(dense_rank last order by x_seq) x_marker_no,
max(x_mark) keep(dense_rank last order by x_seq) x_mark,
sum(y_cnt) y_cnt,
max(y_seq) keep(dense_rank last order by y_seq) y_seq,
max(y_marker_no) keep(dense_rank last order by y_seq) y_marker_no,
max(y_mark) keep(dense_rank last order by y_seq) y_mark
from
(Select st,
decode(Type ,'X',1,0) x_cnt,
decode(type ,'X',seq,0) x_seq,
decode(Type ,'X',marker_no,0) x_marker_no,
decode(Type ,'X',mark,0) x_mark,
decode(Type ,'Y',1,0) y_cnt,
decode(Type ,'Y',seq,0) y_seq,
decode(Type ,'Y',marker_no,0) y_marker_no,
decode(Type ,'Y',mark,0) y_mark
From t
Group By st;
/*this is the output
st X_cnt X_seq X_marker_no X_mark Y_cnt Y_seq Y_marker_no Y_mark
A 2 2 001 12 0 null null null
B 3 3 003 15 0 null null null
C 2 2 002 15 2 4 001 10
ST X_CNT X_SEQ X_MARKER_NO X_MARK Y_CNT Y_SEQ Y_MARKER_NO Y_MARK
A 2 2 1 12 0 0 0 0
B 3 3 3 15 0 0 0 0
C 2 2 2 15 2 4 1 10 -
How to get the max value in the query??
Plant calday(mm.dd.yyyy) Soldout.Qty
0001 01.01.2005 10
0001 01.02.2005 20
0001 01.03.2005 05
0001 01.04.2005 16
0001 01.05.2005 10
0001 01.06.2005 14
From the above values , how can i findout Max(Soldout.Qty)(i.e 20) for the above week...Suppose present aggregation = summation...How can i findout the value in the Query??don't want to do changes to design...Hi Bhanu,
I tried the calculation results as...Maximum,..
But that will pick the maximum value among the avialable values..like
plant1 max 10
plant2 max 20
plant3 max 30
then it will show as..
plant1 max 30
plant2 max 30
...like this...but my case is
plant1 calday1 10
plant1 calday2 05
plan1 calday7 08
plant2 calday1 10
plant2 calday2 05
plan2 calday7 20
so for each set it need to bring the maximum value... -
How to get the Max value of elements of type datetime
Hi All ,
I wanted to get the latest timestamp value ( datatype as datetime) from node list. I have following xml. In this xml, i want to get the modifydate element which has latest timestamp through xquery/xpath, it should return me following result 2011-09-29T17:21:17+10:00
<CustomerList>
<CustomerDetails>
<name> Test 1</name>
<status>active</status>
<modifyDate>2011-08-20T17:21:17+10:00</modifyDate>
</CustomerDetails>
<CustomerDetails>
<name> Test 2</name>
<status>cancel</status>
<modifyDate>2011-08-29T17:21:17+10:00</modifyDate>
</CustomerDetails>
<CustomerDetails>
<name> Test 3</name>
<status>active</status>
<modifyDate>2011-09-29T17:21:17+10:00</modifyDate>
</CustomerDetails>
</CustomerList>
i tried to use the
//CustomerList/CustomerDetails/modifyDate[not(. <=../preceding-sibling::CustomerList/CustomerDetails/modifyDate) and not(. <=../following-sibling::CustomerList/CustomerDetails/modifyDate)]
But it is not working on datetime datatype.
Any help in this regard is much appreciated.
Regards
Edited by: user6736659 on Sep 5, 2011 6:15 AMHi,
The following XQuery should give you what you want :
max(
for $i in /CustomerList/CustomerDetails/modifyDate
return xs:dateTime($i)
)For instance, using Oracle SQL :
SQL> var xmldoc varchar2(4000)
SQL> begin
2 :xmldoc := '<CustomerList>
3 <CustomerDetails>
4 <name> Test 1</name>
5 <status>active</status>
6 <modifyDate>2011-08-20T17:21:17+10:00</modifyDate>
7 </CustomerDetails>
8
9 <CustomerDetails>
10 <name> Test 2</name>
11 <status>cancel</status>
12 <modifyDate>2011-08-29T17:21:17+10:00</modifyDate>
13 </CustomerDetails>
14
15 <CustomerDetails>
16 <name> Test 3</name>
17 <status>active</status>
18 <modifyDate>2011-09-29T17:21:17+10:00</modifyDate>
19 </CustomerDetails>
20 </CustomerList>';
21 end;
22 /
PL/SQL procedure successfully completed
SQL> select xmlquery('max(
2 for $i in /CustomerList/CustomerDetails/modifyDate
3 return xs:dateTime($i)
4 )'
5 passing xmltype(:xmldoc)
6 returning content
7 )
8 from dual
9 ;
XMLQUERY('MAX(FOR$IIN/CUSTOMER
2011-09-29T17:21:17.000000+10:00 -
How to get the max total sale by date on every store
I am trying to write a query in Oracle which will return both the store_id and the maximum total sale by date
Hi,
Whenever you have a question, please 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#9362002
Hjava wrote:
I am trying to write a query in Oracle which will return both the store_id and the maximum total sale by date
Do you mean you want to see the store_id that had the maximum total sale?
In general, this can be done with a Top-N Query, using an analytic function such as RANK. For an example, see http://forums.oracle.com/forums/thread.jspa?messageID=3739610
If you only want the date, the maximum total from that date, and 1 column from the same row with the maximum (e.g. store_id), then you might be able to use the aggregate LAST function instead.
What results do you want in case of a tie? (That is, if 2 or mote store_ids have the same total sale on a given date, and no other store_id has a higher total.) -
How to get the max. and min. of a selection-option?
hi experters
I wonder if there is any way can fetch the max value and minimum value from a select-option?
please hint, many thanks
wanlei.suna®s wrote:
> Try this way
>
>
> SELECT-OPTIONS S_WERKS FOR T001W-WERKS.
>
> START-OF-SELECTION.
> SELECT * FROM T001W INTO IT_T001W
> WHERE WERKS IN S_WERKS.
>
> SORT IT_T001W BY WERKS ASCENDING.
> READ TABLE IT_T001W INDEX 1.
> MOVE IT_T001W-WERKS TO V_WERKS_MIN. " MIN Value
>
> SORT IT_T001W BY WERKS DESCENDING.
> READ TABLE IT_T001W INDEX 1.
> MOVE IT_T001W-WERKS TO V_WERKS_MAX. " MAx Value
>
>
> a®s
Please try this.
TABLES : t001w.
SELECT-OPTIONS S_WERKS FOR T001W-WERKS.
data: lv_min type T001W-WERKS,
lv_max type T001W-WERKS,
lv_count type i.
START-OF-SELECTION.
sort s_werks by low.
describe TABLE s_werks LINES lv_count.
if lv_count = 1.
lv_min = s_werks-low.
lv_max = s_werks-high.
elseif lv_count > 1.
read TABLE s_werks index 1.
lv_min = s_werks-low.
if not s_werks-high is INITIAL.
lv_max = s_werks-high.
endif.
READ TABLE s_werks INDEX lv_count.
if lv_max is INITIAL.
lv_max = s_werks-low.
else.
if lv_max < s_werks-low.
lv_max = s_werks-low.
endif.
endif.
endif.
write :/ lv_min,
lv_max. -
How to get the MAX,MIN from the below table...
Hi,
Database is SQL2012 R2 Express and I have a table and would like to dig out the MAX,MIN value of a specifiied date (e.g 2014-11-03)
ThanksNope... It still output more than 1 value on the same date...
DL-01-BAT 13.00753 13.00753 10/10/2014
DL-01-BAT 13.01342 13.01342 10/10/2014
DL-01-BAT 13.02706 13.02706 10/10/2014
DL-01-BAT 13.03485 13.03485 10/10/2014
Raw data is
DL-01-BAT 13.00753 13.00753 10/10/2014 20:00
DL-01-BAT 13.01342 13.01342 10/10/2014 21:00
DL-01-BAT 13.02706 13.02706 10/10/2014 22:00
DL-01-BAT 13.03485 13.03485 10/10/2014 23:00
You mean after applying my suggestion?
I dont think so
See illustration below
declare @t table
Item VARCHAR(10), Reading VarChar(50),DateTimeReading DATETIME)
INSERT @t
VALUES
('DL-01-BAT', 13.00753,'10/10/2014 20:00'),
('DL-01-BAT', 13.01342,'10/10/2014 21:00'),
('DL-01-BAT', 13.02706,'10/10/2014 22:00'),
('DL-01-BAT', 13.03485,'10/10/2014 23:00')
DECLARE @Date datetime = '20141010'
SELECT Item,
MAX(Reading) AS [Max],
MIN(Reading) AS [Min],
DATEADD(dd,DATEDIFF(dd,0,DateTimeReading),0) AS [Date]
FROM @t
WHERE DateTimeReading >= @Date
AND DateTimeReading < DATEADD(dd,1,@Date)
GROUP BY Item, DATEADD(dd,DATEDIFF(dd,0,DateTimeReading),0)
Please Mark This As Answer if it solved your issue
Please Mark This As Helpful if it helps to solve your issue
Visakh
My MSDN Page
My Personal Blog
My Facebook Page -
How to get the max P2P avlue of a signal
Hello!
I'm very new to the whole LabView program, and have some issues with very basic need I have to apply to my program.
I need to measure the max P2P of a signal and preform some analysis on that, the problem is that the Amplitude and measurments VI gives me the P2P at every given sample. Is there any way for doing this right?
Thank you
Solved!
Go to Solution.You can store it in a shift register.
A shift register is one of those basic elements of LabVIEW that you must become familiar with. Have you taken any of the tutorials?
Message Edited by Dennis Knutson on 02-03-2010 10:52 PM
Attachments:
Keep Max.PNG 3 KB -
How to get the sales price of sales SET
Hi,
I want to get the sales price of a sales set, is ther any fm bapi our class to doe that?
thanzs in advanced to all
JaimeProblem Solved
-
Hi all,
i got in the cube this example
client Max reveneu
A 5
A 4
A 1
B 2
B 2
B 2
The report show this
A 10
B 6
I want that the report show
A 5
B 2
How can i do it? i have been trying with the atributes and doesnt do it , please helphi,
You can do it in 2 ways-
1.In key figure properties,Aggregation tab->select exception aggregation as MAXIMUM and ref.Char say client.
2.Create CKF in query designer ->Drag and drop revenue KF,in aggregation tab select Maximum and ref.Char say client.
Rajendra -
How to get the XML TAG name itself instead of TAG value
Hi All,
I have a question here
I want to retrieve the XML tag from a XML file instead of its value.
Example:
<item>Colgate</item>
Now I want to retrieve "item" as output from XPath expression, I dont want its value as "colgate"
How to do that...?
Thanks
-PraveenYou can do this with an axes XPatch expression:
child::node()/name()
For more info see: http://www.w3schools.com/xpath/xpath_axes.asp
HTH,
Bas -
How to get the list of parameter and set them using RESTFul WS for a Crystal Report
Hi All,
I am able to schedule a Crystal report using following POST Restful call - http://localhost:6405/biprws/infostore/4738/scheduleForms/now and with a request xml body. But report is failing because I am not passing the parameter.
But I need pass parameters/prompts to the Crystal report to execute successfully.
What is the request XML to pass the parameter for the report?
I was able to do this for WEBI reports but I am not able to find any way to do this for Crystal reports?
Any help on this matter is really appreciated.Hi Venki
Please have a look at:
How to pass parameters and generate the report using RESTful API in VB.net
This is also described in the Developer Help files:
http://help.sap.com/businessobject/product_guides/sbo41/en/sbo41_webi_restful_ws_en.pdf
- Ludek
Senior Support Engineer AGS Product Support, Global Support Center Canada
Follow us on Twitter -
How to retreive the max data length of a column
Hello All,
I know how to do a select to get the max data length of a column it is this :
SELECT MAX(LENGTH(COLUMN_NAME) FROM table.
However, I need this information combined with my SQL that returns the Data_type and length from the USER_TAB_COLUMNS. So taking the emp example if the ename column was 50 as VARCHAR2 but the max data entered in it was just 20 I want the information like this:
SELECT COLUMN_NAME, DATA_LENGTH, and the Max length of 20
FROM USER_TAB_COLUMNS WHERE TABLE_NAME='EMP';
I don't know how to get the Max Length of the Column in this table. Can anyone suggest me a hint? An Inline view maybe?
ThanksStill not sure about your requirements, but how about this
SQL> CREATE OR REPLACE FUNCTION get_max_length(p_table in varchar2, p_col in varchar2) return pls_integer
2 is
3 v_cnt pls_integer;
4 begin
5 execute immediate 'select max(length('||p_col||')) from '||p_table into v_cnt;
6 return v_cnt;
7 end get_max_length;
8 /
Function created.
SQL>
SQL> SELECT COLUMN_NAME,
2 DATA_LENGTH,
3 get_max_length(TABLE_NAME, COLUMN_NAME) max_length
4 FROM USER_TAB_COLUMNS
5 WHERE TABLE_NAME='EMP'
6 AND DATA_TYPE like '%CHAR%'
7 ;
COLUMN_NAME DATA_LENGTH MAX_LENGTH
ENAME 10 6
JOB 9 9
SQL> -
How to get the "Key" for Dimension in SSAS.
Hi
How to get the "Key" for Dimension in SSAS.
(Below value is the PPSParameters table XML column value in PPSDatabase in SharePoint.
Below three key values are belongs to "Dimension". I have tried to find the key but I could net get it.)
<NewDataSet>
<UserValues><Key>16A201A9E75128559F947D58E6D187A9</Key></UserValues>
<UserValues><Key>7FBEA449A6ED5606973306445839619E</Key></UserValues>
<UserValues><Key>A8F75F9720817BCD2E1DFC1C1CF1E678</Key></UserValues>
</NewDataSet>
Thanks & Regards
Poomani SankaranTo Be Honest there is not one straight Cmdlet that atleast I have come across
The best way would if you have Lync monitoring server
Using the Lync Server 2013 Monitoring Server
If you have the Monitoring Server role configured in your environment, and for Lync Server 2013 everyone should!, you can use information contained in the LcsCDR database to pull back the last time a user signed in. You can run the following query* to
pull back the user's SIP URI and their last login time:
USE LcsCDR
SELECT dbo.Users.UserUri, dbo.UserStatistics.LastLogInTime
FROM dbo.UserStatistics
JOIN dbo.Users ON dbo.Users.UserId = dbo.UserStatistics.UserId
ORDER BY UserUri
Which produces the following output:
The advantage to using the Monitoring Server to obtain this data is that unlike the information contained in the rtcdyn database, the information from the LcsCDR data will persist even when the user isn't signed into Lync.
To get approx count of users enable for Lync Server in your organisation
Get-CsUser -Filter {Enabled -eq $true} | MeasurE
Please not the above command let will give you an approx number not exact
From the Monitoring report yet the SIP account that signed in and then from count find out how many user havent signed in this is manual task
Hope this is helpful
Please remember, if you see a post that helped you please click ;Vote As Helpful" and if it answered your question please click "Mark As Answer" Regards Edwin Anthony Joseph
Maybe you are looking for
-
I have a MacBook Pro running Yosemite.I did not shut down the computer last night. When I opened the computer this morning Dashboard in overlay was on the screen. I have not been able to get out of dashboard. I have tried esc, F12, and accessing S
-
7.0 Create forms based on Access data -David O'Hanlon are you there?
Hi - Using a pdf created using LiveCycle 7.0<br /><br />I'm trying to create xFDFs using data from an Access database. The xFDF should then be e-mailed to users who fill out the forms and return xml files by e-mail. I then parse out the xml in to S
-
In contacts on my new i Mac the country field does not show in the label print pre view or the printed label. Any suggestion of why this is happening?
-
Hey guys, I have a 13' white, early 2008 macbook. I upgraded to Snow Leopard right when it came out. Everything ran fine, and better, for a few weeks. At some point, things started going downhill. I didn't do anything special or wrong to make it do t
-
[SOLVED] How to get a list of ignored packages?
I'm trying to make a script to compile my already *AND UP TO DATE* installed packages for my cpu. Right now it works well, but i'm facing the issue that i've to avoid building packages that are in my ignoregroup or ignorepkg (say - an old version of