How to get the measure total at row level for another measure calculation in DAX?
Hi There,
Using DAX, I am trying to get an expression for a calculated measure as follow:
So basically, I would like to get the AMeasure total highlighted in yellow in the A2Measure calculation:
Smeasure -(Ameasure total * WMeasure) where Ameasure total is the one highlighted.
I think my question would be how to get the total of a measure in order to used in the calculation of another measure.
Thanks and best regards,
Joss
Hi Joss83,
If you're trying to get the result for [AMeasure] at the total level (i.e. 5.09 in your example) you can do this by creating a version of this measures that is evaluated after ignoring the filters (indirectly or explicitly) placed on
the 'Customer' and 'Player' columns. You may also need to ignore the filters place on some other tables or columns that must be ignored in order for the correct total to be returned.
Without knowing much more about your data model, I can only take a vague guess as to what this calculation would look like in your scenario:
AMeasureTotal:=
CALCULATE(
[AMeasure],
ALL(Customer[Customer]),
ALL(Player[Player])
You can read more about the 'ALL' DAX function here:
http://technet.microsoft.com/en-us/library/ee634802.aspx
Hope this helps,
Michael
Similar Messages
-
How to get the Grand Total in Module pool Screen
Hi Frds.
How to get the Grand Total in Module pool Screen
Example i have 10 different materials
for each matarial has different moving . But in my case matarials is doesnt matter here
10 material Moving Average price to do Frand total and display in one column...
Please Help me out Frds.
Regards,
KabilHi
You need to calculate the total in a module of PAI (or PBO) event:
PROCESS PAI.
LOOP.....
ENDLOOP.
MODULE CALCULATE_TOTAL.
MODULE CALCULATE_TOTAL.
GRAND_TOTAL = 0.
LOOP AT ITAB,
GRAND_TOTAL = GRAND_TOTAL + ITAB-PWB.
ENDLOOP.
ENDMODULE.
In this way the grand total will be calculated as soon as the user presses enter or another command.
You can't insert the calculation in the loop of table control, because this loop runs the visible lines only, so it's better to calculate the total out of those loop, -
How to get the number of decimal places configured for a site column
Hi,
I have a column 'SampleNumCol' of type Number, the number of decimal places to be displayed is configured as 2.
The column conatins a value, but when retrieved programatically is displayed as 5.00000000 instead of 5.00.
I am retrieving this column using listitem.Properties[field.InternalName].
I need to trim the decimals based on number of decimal places configured for the site column.
How to get the number of decimal places configured for a site column?
Thanks in advance,
dhijitGet the field as SPFieldNumber and then check DisplayFormat which returns
SPNumberFormatTypes
SPFieldNumber numberField = list.Fields.GetFieldByInternalName("YourNumberFieldName") as SPFieldNumber;
SPNumberFormatTypes numFormatType = numberField.DisplayFormat; -
Does anyone know how to get the vendor ID and product ID for NI-Visa? TIA
Does anyone know how to get the vendor ID and product ID for NI-Visa? TIA
This question has already been addressed in this thread:
Does anyone know how to get the vendor ID and product ID for a USB device in NI-Visa?
John M
National Instruments -
Does anyone know how to get the vendor ID and product ID for a USB device in NI-Visa? TIA
Does anyone know how to get the vendor ID and product ID for a USB device in NI-Visa? TIA
Hello,
Exactly which USB device are you referring to? Is the device a NI product?
The Product ID for National Instruments DAQPad-6020E is 0x12C0. The USB vendor ID is 0x3923. This is a 16-bit hexadecimal number(1093) (that is decimal 4243).
Also, here's a document on our website that will help you in configuring NI-VISA to control your USB device:
http://zone.ni.com/devzone/conceptd.nsf/webmain/6792BAB18242082786256DD7006B6416?opendocument
Swapnil P.
National Instruments Engineer -
How to get the sum total of just one row in the dashboard
How do I get the sum total of one row in the compound layer results. This is 11g
Does anyone know?
may be sales, I need the total at the bottom of the row..
thx
ChuckI fnd the answer,
in the table view, click edit then nxt to the columns and measures there is total sum icon. Click that, and choose after -
How to get the group totals in report
HI,
Iam generating a report to display Storage Location, and Unit of Measures and Material group and also group totals.
how to display the group totals on the report.
thank q
rushi.Hi,
This following report clearly explains how to display the subtotal and grand total of
the particular field in alv.
REPORT YMS_ALVSUBTOTAL.
*REPORT z_alv_sub_totals .
TYPE-POOLS: slis.
DATA: BEGIN OF it_output OCCURS 0,
var1(8) TYPE n,
var2(10),
var3 TYPE I,
END OF it_output.
DATA: it_fieldcat TYPE slis_t_fieldcat_alv,
t_fieldcat TYPE slis_fieldcat_alv,
it_sort TYPE slis_t_sortinfo_alv,
t_sort TYPE slis_sortinfo_alv,
v_repid LIKE sy-repid.
INITIALIZATION.
v_repid = sy-repid.
START-OF-SELECTION.
PERFORM get_data.
PERFORM sort_fields.
PERFORM fill_fieldcat.
PERFORM list_display.
*& Form GET_DATA
text
--> p1 text
<-- p2 text
FORM get_data.
it_output-var1 = 1000.
it_output-var2 = 'anupama'.
it_output-var3 = '10000'.
it_output-key = 'X'.
APPEND it_output.
CLEAR it_output.
it_output-var1 = 1000.
it_output-var2 = 'siddhu'.
it_output-var3 = '20000'.
APPEND it_output.
CLEAR it_output.
it_output-var1 = 1000.
it_output-var2 = 'chinni'.
it_output-var3 = '100000'.
APPEND it_output.
CLEAR it_output.
it_output-var1 = 2000.
it_output-var2 = 'chicchu'.
it_output-var3 = '10000'.
APPEND it_output.
CLEAR it_output.
it_output-var1 = 2000.
it_output-var2 = 'candy'.
it_output-var3 = '10000'.
APPEND it_output.
CLEAR it_output.
it_output-var1 = 1000.
it_output-var2 = 'anupama'.
it_output-var3 = '10000'.
APPEND it_output.
CLEAR it_output.
it_output-var1 = 4000.
it_output-var2 = 'anupama'.
it_output-var3 = '10000'.
APPEND it_output.
CLEAR it_output.
ENDFORM. " GET_DATA
*& Form fill_fieldcat
text
--> p1 text
<-- p2 text
FORM fill_fieldcat.
PERFORM fill_fields USING: 'IT_OUTPUT' 'VAR1' 'Variable 1' ' ',
'IT_OUTPUT' 'VAR2' 'Variable 2' ' ',
'IT_OUTPUT' 'VAR3' 'Variable 3' 'X'.
ENDFORM. " fill_fieldcat
*& Form fill_fields
text
-->P_0146 text
-->P_0147 text
-->P_0148 text
-->P_0149 text
FORM fill_fields USING value(tabname) TYPE slis_tabname
value(fieldname) TYPE slis_fieldname
value(seltext_m) LIKE dd03p-scrtext_m
value(do_sum) TYPE c.
t_fieldcat-tabname = tabname.
t_fieldcat-fieldname = fieldname.
t_fieldcat-seltext_m = seltext_m.
IF do_sum = 'X'.
t_fieldcat-datatype = 'CURR'.
ENDIF.
t_fieldcat-do_sum = do_sum.
APPEND t_fieldcat TO it_fieldcat.
CLEAR t_fieldcat.
ENDFORM. " fill_fields
*& Form list_display
text
--> p1 text
<-- p2 text
FORM list_display.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = v_repid
it_fieldcat = it_fieldcat
it_sort = it_sort[]
TABLES
t_outtab = it_output
EXCEPTIONS
program_error = 1
OTHERS = 2
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " list_display
*& Form sort_fields
text
--> p1 text
<-- p2 text
FORM sort_fields.
t_sort-fieldname = 'VAR1'.
t_sort-tabname = 'IT_OUTPUT'.
t_sort-spos = 1.
t_sort-up = 'X'.
t_sort-subtot = 'X'.
APPEND t_sort TO it_sort.
CLEAR t_sort.
t_sort-fieldname = 'VAR3'.
t_sort-tabname = 'IT_OUTPUT'.
t_sort-spos = 2.
t_sort-up = 'X'.
APPEND t_sort TO it_sort.
CLEAR t_sort.
ENDFORM. " sort_fields
Thanks,
Sankar M -
HOW TO GET THE GRAND TOTALS IN ALV USING GRID FM
Hi,
I would like to know that am getting the sub totals using the ALV_GRID FM,
But I need Grand totals how i can get and what is the paramater to keep = x to get this Grand totals\.Hi,
If you have the DO_SUM = 'X' in the field catalog internal table for the corresponding column..Then you will get the grand total..
Thanks,
Naren -
How to get the index of a row in dynamically generated list
Hi,
I am displaying a list which contains 6 rows using <logic:iterator/>
If i am changing a text value which is in 3 row, I want to pass that row index to the javascript function.
I am using IndexId attribute of <logic:iterator> to get the index of a row,but
It is working fine for Hyperlink buttons, but it is no working for text boxes.
can any one plz help me..
Thanks,
madhumadhu,
Please post your code... It's a bit like asking a mechanic to fix your car blind folded. -
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.) -
Hello BW gurus,
sorry for the incomplete question.
This is how i need my report.
Account Number Key Figure Type Company code Plant Sales Organization Fiscal year/period Z1/007.2006 Z1/008.2006 Z1/009.2006 Z1/010.2006 Z1/011.2006 Z1/012.2006
SALES x1
SALES x2
SALES x3
SALES x4
SALES x5
SALES x6
Overall Result SALES x1x2..x6
Similarly i need to get the cost of sales and its overall results
and then i have to get the gross margin as (Sales - Cost of Sales) for each fiscal period(columnwise).
i got the Sales and Cost of Sales like this
Plant Sales Organization Fiscal year/period
SALES
COST OF SALES
GROSS MARGIN
SALES
COST OF SALES
GROSS MARGIN
SALES
COST OF SALES
GROSS MARGIN
SALES
COST OF SALES
GROSS MARGIN
SALES
COST OF SALES
GROSS MARGIN
SALES
COST OF SALES
GROSS MARGIN
SALES
COST OF SALES
GROSS MARGIN
but i need all the sales data first and its total(S)
and then all the cost of sales data and its total(C)
and the gross margin (S-C) for individual fiscal period.
Please reply ASAP.Quick help is appreciated.
Thanks in advance,
Regards
Sam MathewHi Viraylab,
check <b>VBAP-NETPR</b> field of table <b>VBAP</b>
It gives the net price corresponding to a line item.
Goto Tcode VA03.See the <b>item overview</b> tab U will get <b>Net Price</b> field for indivisual line item.
Reward points if helpful.
Regards,
Hemant -
How to get the values of all rows in advanced table
HI All,
I am using an advanced table to enter the values for the service contract line (its a custom page)in that advanced table i ahave column with lov called task number for that task number once i had choosed one task number and creating one more row using add anethor row button i want to restrict the user to not to choose the task number which was entered in the previus row.
Or if this is not possible i want to restrict the user by showing an error message when click on the submit button by saying you have choosed the duplicate task number please choose a uniqu task number
please give some hints
thanks
ajayHi
your approach will have two steps
1.) use the row refernce and get the value of task number of the row which is enterd by user .
2.) use getRows in range and compare values of task number of every row with the user selected value ,if value match then throw error.
Thanks
Pratap -
How to get the index of table row without selection?
Hi all,
I have an table designed in XML view.Now i have added an change method for qty cell "valqty". When user inputs the qty in the cell and press enter this method is triggered now I want to know which index of the table is currently edited.Through which i can get the value of other cell in the same row.
NOTE: The table row doesn't have selection either multiple or single
I tried the following inside the valqty method but it now working
this.getValue();
this.getBindingContext().getProperty('PRD_NUM');
<Table id="idProductsTable"
inset="false"
items="{oModel>/deliverylist}"
visibleRowCount= "7"
mode="MultiSelect"
modeAnimationOn="true">
<headerToolbar>
<Toolbar>
<Label text="Products"></Label>
</Toolbar>
</headerToolbar>
<columns>
<Column
minScreenWidth="Tablet"
demandPopin="true">
<Text text="Order" />
</Column>
<Column
minScreenWidth="Tablet"
demandPopin="true">
<Text text="Quantity" />
</Column>
</columns>
<items>
<ColumnListItem>
<cells>
<Text text="{oModel>PRD_NUM}" />
<Input value="{oModel>DEL_QUAN}" change="valqty" maxLength="13" />
</cells>
</ColumnListItem>
</items>
</Table>
ThanksThanks Robin,
But in my case oEvent.getSource() is returning the cell instance and
oEvent.getSource().getBindingContext() is undefined
Hence not getting the value
I also tried the following
oEvent.getSource().getParent().getParent().indexOfItem()
But index returned is -1 -
How to get the grand total ?
Hi all,
I got 1 main query say Q1 link to another 3query, Q2, Q3 & Q4. In Q2, Q3 & Q4, I got the difference qty display based on individual repeating frame. Now if I need to sum the grand total of Q2, Q3 & Q4 ? how should I do ?
I try to put the sumary up in Q1, but the system has given REP-1517 error.
Any idea please help me. Thanks.
Rgds
LimAdd summary columns in your data model. Where to put them exactly depends on your report. E.g. if you want a grand total at the end of the report, you create the column outside the query. The Object Navigator shows a Summary Columns node beneath the Queries node for these columns.
-
How to get the value in one JSP page to another?
Hi,
I have problems in passing the value around in JSP. I have two JSP pages as below:
test1.jsp
I try to get the vaule from my textbox by using:
String strUser = request.getParameter ("strUserName");
Then i print out by using: out.print(strUser); then i can get the value and put on my page (For example, i get ABC on my page).
test2.jsp
Next, i want to get the value from strUser (which mean that the one i already display on page in test1.jsp, ABC) to insert into my table by using INSERT INTO statement. Then i try by using
String strUser1 = request.getParameter ("strUser");
Is it possbile for me to do that? I cannot get anything to insert into my table. Then i tried out.print(strUser1); then i found that i get NULL value.
Could you please give me some guidance?
Thanks you very much for any advise you may give me.
KimsanHi,
Thank you very much for your help. It's working fine if i just get a one value to another page, however, i have problem while i pass the value in my loop to another page because i always get the last record. I try with the following code:
logged_page.jsp
<html>
<head>
<title>Welcome to the online Auction...</title></head>
<body>
<%@ page language ="java" import = "java.io.*, java.lang.*, java.sql.*" %>
<% try
String strUsername = request.getParameter("username");
session.setAttribute("myUserName", strUsername);
String strPassword = request.getParameter("password");
Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver");
Connection myConn = DriverManager.getConnection("jdbc:odbc:Driver={MicroSoft Access Driver (*.mdb)};DBQ=C:/Auction/Auction.mdb");
String strSQL = "SELECT [UserName], [Password] FROM tblUserDetails where [UserName] = ? and [Password] = ?";
PreparedStatement statement = myConn.prepareStatement(strSQL);
statement.setString(1, strUsername);
statement.setString(2, strPassword);
ResultSet myResult = statement.executeQuery();
if(myResult.next())
//out.println("Login Succesful! A record with the given user name and password exists");
out.print("<center><h1>");
out.print("Welcome ");
out.print(strUsername);
out.print("</h1></center>");
out.print("<center>");
out.print("<BR><BR>");
out.print("<font font face = Viner Hand ITC size= 5>Products on sales</font>");
out.print("<BR><BR>");
Statement myStatement = myConn.createStatement ();
ResultSet myResult1 = myStatement.executeQuery("SELECT * FROM tblProduct");
ResultSetMetaData myResultSet = myResult1.getMetaData();
out.println("<font face=Tahoma>");
out.print("<table border=1 CELLSPACING=0>");
out.print("<TR>");
out.print("<TD width = 200> Item Title");out.print("</TD>");
out.print("<TD width = 200> Description");out.print("</TD>");
out.print("<TD width = 200> Current bid");out.print("</TD>");
out.print("<TD width = 200> Available Time");out.print("</TD>");
out.print("<TD width = 200> Place Bid");out.print("</TD>");
out.print("</TR>");
out.print("</table>");
while(myResult1.next())
String strProName = myResult1.getString(1);
session.setAttribute("myProName", strProName);
out.print("<table border=1 CELLSPACING=0>");
out.print("<TR>");
out.print("<TD width = 200>");
out.println(strProName);
out.print("</TD>");
out.print("<TD width = 200>");
out.println(myResult1.getString(3));
out.print("</TD>");
out.print("<TD width = 200>");
out.println(myResult1.getString(2));
out.print("</TD>");
out.print("<TD width = 200>");
out.println(myResult1.getString(4));
out.print("</TD>");
out.print("<TD>");
out.print("<form action=bid_page.jsp method=post>");
out.print("<input type=text name=place_bid>");
out.print("<input type=submit name=okfunc value=Bid>");
out.print("</TD>");
out.print("</form>");
out.print("</TR>");
out.print("</table>");
out.println("</font>");
out.print("</center>");
else
out.print("<center>");
out.print("Sorry ");
out.print("<font color = RED size = 5>");
out.print(strUsername);
out.print("</font>");
out.print(" could not be found.");
out.print("</center>");
myResult.close();
statement.close();
myConn.close();
catch(SQLException e)
out.println(e);
%>
</body>
</html>
bid_page.jsp
<HTML>
<HEAD>
<TITLE>Welcome to the online Auction...</TITLE>
</HEAD>
<BODY>
<%@ page language ="java" import = "java.io.*" import = "java.lang.*" import = "java.sql.*" %>
<% try
String thisUserName = (String) session.getAttribute("myUserName");
String thisProName = (String) session.getAttribute("myProName");
Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver");
Connection myConn = DriverManager.getConnection("jdbc:odbc:Driver={MicroSoft Access Driver (*.mdb)};DBQ=C:/Auction/Auction.mdb");
PreparedStatement myStatement = myConn.prepareStatement("INSERT INTO tblHistory VALUES ('"+thisUserName+"', '"+thisProName+"', '"+request.getParameter("place_bid")+"')");
myStatement.executeUpdate();
myConn.commit();
myStatement.close();
myConn.close();
catch(Exception e){}
%>
</BODY>
</HTML>
When i click on the BID button in the logged_page.jsp then i always get the last record and save into my table and that is not what i want to. i want to get the result on the same row as the BID button that just click and save to my table.
Could you please advise?
Thanks you very much for your time and any consideration you may give me.
Best Regard,
Kimsan
Maybe you are looking for
-
Index not created but it still reserved space on the disk
Hi all, I have got a problem with creating an index. I am using oracle 10.2 DB on Windows 2003 Server. There are several jobs that are running at night to collect data from another database. Therefor I am always dropping the indices (for faster inser
-
How can i get safari to sync reading list from my home mac and my work pc?
im using windows 7 on my pc at work and snow leopard on my mac pro at home. can i do this?
-
Started to get pop ups when tried to open a video on face book. Directed for a download of MPlayerX-2.dmg and did attempt to install but never got video up/. Error message also states to To fix it please call Support for Apple +1 800-680-4131 (Toll F
-
Usually very fast, Sometimes painfully slow. Why?
There probably is no simple answer to this, but I'll ask anyway. I am test driving Aperture 2.0.1 and so far like it a lot. But every now and then, on particular photos, it seems to slow to a crawl. For example, I have one photo that I shot a couple
-
Hello! When i want to check out documents, the Function BAPI_DOCUMENT_CHECKOUT2 only checks the documents out in the unix file system of the server the dms is running. Is there another possibility to get the file content by a JAVA Application to stor