I'm tring to create a report that contains produced items in a certail timeline.
How or where can I find completed items. My prodtable contains mostly half products.
It should look like: Order reference - Date - Ordered items - produced items
Search for "Reference level" equal zero.
while select prodTable where prodTable.CollectRefLevel == 0
{ ... }
Related
I have a cross table in business objects web intelligence which has customer IDs in the rows, items in the columns and quantity in the body. I am trying to create a variable (dimension?) that will flag whether a customer has bought one particular item plus any other item. So, if for example the set item is 'item1' then the flag would show if the customer bought that and also if they bought at least one other item which could be any from another 100 or so. I am trying to write something that is akin to looking at two Booleans returning opposite results in the same statement.
if([item]="item1" And [quantity]>0;"Y";"")
and combine it with something like:
if([item]<>"item1" And [quantity]>0;"Y";"")
At the moment I can only get one or the other working and I can't then seem to create any further variable that would combine them because I end up with "Y" for all rows which is not correct. This is how the table might look after (mock-up in Excel):
I want to then be able to filter based on the flag results variable. Can anyone advise how I might address this problem?
You are really close. I defined count (or quantity) variables with where clauses. I created Var Select Item Count as...
=[quantity] Where ([item] = [your selected item])
And Var Other Items Count as...
=[quantity] Where ([item] <> [your selected item])
Finally, define your FLAG variable as...
=If([Var Select Item Count] > 0 And [Var Other Items Count] > 0; "Y")
Then you can filter on your FLAG variable.
Certainly, you could embed the code from the first two variables into the last one. However, I like to create my variables such that they build upon one other for easier understanding and maintenance.
Here is my example with "173" being the selected item.
My query includes 4 groups. Category > Type > Activity > Nature > detailPrice.
I have the report built with 4 different List Items stacked into each other. Each list is one of the four groups. The detailPrice is a table (pink).Each of the 4 groups has a different colored border, to differentiate (just for testing).
Each list shows a Total of the previous list. List 2 (Activity) shows the sum total of the entries in List 1 (Nature), and so on. The total of List 4 (Category) shows the grand total of all the previous lists.
My 3rd List's group (Type) is always split into two sections: Revenue and Expenses. So there are two totals in the 3rd List's grouping: the first is 90033, the second is 37627.
Here's the total of Revenue. Only the first number matters, which is 90033.
Inside my fourth list (Category), rather than just show the grand total (of Revenue - Expense), I want to show both the total of Revenue and Expenses, and then show the grand total.
For the Grand Total, I simply sum the proper field. But I am unable to get the 90033 and 37627 I need.
I've tried many different options:
When the 3rd list sums the Revenue, I put that value in a custom code variable, and then the same with Expenses. =IIF(Fields!Type.Value = "Revenue", Code.addTotal("R",SUM(Fields!detailPrice.Value)) (the function simply adds the detailPrice to one of two variables: totalR and totalE depending on the first parameter)
I tried the same with a Report Variable =IIF(Fields!Type.Value = "Revenue", Variables!totalR.SetValue(SUM(Fields!detailPrice.Value)))
I also tried Running Values, but didn't get very far.
I can't simply access the ReportItem!total of the 3rd group, as I am trying to get it from outside the group.
After all my attempts, my two variables (totalR and totalE) have the same value: 37627. I can never get 90033 as well as 37627. I can get the total of Expenses... but not Revenues. I feel like the total of the Expenses group overrides the Revenue value, but I have no idea how to keep that 90033 to use it outside of the group.
Is it possible to reference each total in a group outside of said group?
I am trying to create a form that takes sums from certain fields and displays it next to its appropriate field name. I've attached pictures of it in datasheet form (how it's displayed) and its design form.
In more detail, the description items on the left are the "fields" (that I will call "tags" from now on and will be listed in other tables in a column called Associated Bid Items). I've basically tagged several other items in tables and queries throughout my Access App. I am trying to collect all items with the same tags/fields and add up Total MH (man-hour) units associated with these items.
The code I have in the second textbox in the second image is:
=DSum("[Total MH]","qry-PipingHandleMH","[Associated Bid Item]=[Text_BidItem].Value")
where Total MH is what I am summing up, qry-PipingHandleMH is the query I'm pulling from, and Text_BidItem is the first textbox in the second image. I want to sum only the Total MH where the Associated Bid Item (column in other tables where the tags are listed) matches Text_BidItem.
NOW THE PROBLEM: Several items in other tables and queries have already been tagged with each of the tags shown in the first image. Each of those descriptions/tags in the first image should have a Total MH associated with it. The SQL code above does not separate the totals into its rows appropriately as shown in the first image. Here is the longer version of the code:
=DSum("[Total MH]","qry-PipingHandleMH","[Associated Bid Item]=[Text_BidItem].Value")+DSum("[Total MH]","qry-PipingMakeupMH","[Associated Bid Item]=[Text_BidItem].Value")+DSum("[Total MH]","qry-PipingValvesMH","[Associated Bid Item]=[Text_BidItem].Value")+DSum("[Total MH]","qry-PipingWeldingMH","[Associated Bid Item]=[Text_BidItem].Value")+DSum("[Total MH]","qry-CoatingAGMH","[Associated Bid Item]=[Text_BidItem].Value")+DSum("[Total MH]","qry-CoatingUGMH","[Associated Bid Item]=[Text_BidItem].Value")
Basically the same code applied to different tables but added together. That's is whats really in the second textbox in the second image currently. As you can see in the first image it is all applied to the "Large Bore Piping 2" and greater" row. Why isn't the summation of Total MH seperating into its respective rows? DSum() is working but the filtering and separation is just all wrong.
Must concatenate variable parameters. Reference to Text_BidItem is a variable parameter.
=DSum("[Total MH]","qry-PipingHandleMH","[Associated Bid Item]=" & [Text_BidItem])
If [Associated Bid Item] is a text type then will need apostrophe delimiters:
=DSum("[Total MH]","qry-PipingHandleMH","[Associated Bid Item]='" & [Text_BidItem] & "'")
Advise no spaces or punctuation/special characters (underscore only exception) in naming convention.
I am new to SSRS. I have a report that goes like this
Type Amount
A 500
B 200
A 100
C 400
C 200
I want to convert this to a report like this
Type Total Amount
A 600
B 200
C 600
Basically get distinct Types on the left column and th totals for those types in the right column. Is there a way i can do that easily?
Thanks
Starting with you simple report which just lists the records in your DataSet:
Design:
Results:
Right click on (Details)in the Row Groups section and choose Add Group -> Parent Group:
Choose the field you want to group by (Type in our example) from the Group by: dropdown, choose to add either a group header or footer and click OK:
Your table will now look something like this:
You can delete the second column and the third row - or second row if you chose to add a group footer earlier - entirely (clicking OK when deleting the row and being prompted to delete the associated group), leaving a layout like this:
Now just click the field selector for the empty cell in the table and choose your Amount field:
or right click on the empty cell, choose Expression from the context menu and enter the following expression:
=Sum(Fields!Amount.Value)
either of which should result in the formula being placed into the cell:
Now run your report and you should get the expected result:
There's loads of places online with similar guides and resources which you can also consult:
MSDN Reporting Services Tutorial (Adding Grouping and Totals)
MS TechNet (Calculating Totals and Other Aggregates)
MSDN (Add a Total to a Group or Tablix Data Region)
There are also several other similar questions here on SO which you'll find if you just search for them.
I've been struggling with the following for a while and would be more than happy for some brainpower ;)
I have an Advanced filter form, which filters through orders via many different filters, currently the one that I can't make function is the following:
I have 4 controls on a form (all unbound):
ogProductType - option group that allows you to pick from 3 types of products
lbAllProducts - list box displaying all types of products. It has 2 rows, and gets filtered by tbSearchProducts which searches by the name of the product, but the lb is bound by the first row which is the product code. The filter is done by inserting criteria into the name row:
"Like "*" & [tbSearchProducts] & "*"".
tbSearchProducts - text box for searching the product by name. Has requery for lbAllProducts OnChange.
Main orders list box - lbOrders - which has many rows. The ones we care about in this case are ID; eProductCode; fProductCode; kProductCode. It is supposed to display all IDs of all orders where the filters are true (all orders where type 1 product is bought). In the query builder I have the following code as criteria for each them:
In lbOrders:
for eProductCode row
IIf([ogProductType]=1 And Len(Nz([lbAllProducts]))>0;[lbAllProducts];"")
for fProductCode row
IIf([ogProductType]=2 And Len(Nz([lbAllProducts]))>0;[lbAllProducts];"")
for kProductCode row
IIf([ogProductType]=3 And Len(Nz([lbAllProducts]))>0;[lbAllProducts];"")
I want the Main list box to be filtered depending on what type of product was chosen (eProductCode is chosen with the option group set on First option = 1; fProductCode = 2; kProductCode=3), but ignore the other 2 rows totally. Sadly, with that false statement saying the criteria for the field is "", in case it was not chosen via the option group, it doesn't work.
How can I stack 3 criteria, all taking values from the same list box, but only if option group is the right on, without them interfering with each other?
I tried with "*" in false and it doesn't work...
Any ideas?
I've solved it :)
You simply never use the criteria to filter the 3 rows... You just use the field itself to load the proper row that you need and put in criteria...
Here is the code for the field:
Expr1: IIf([obProducts]=1 And Len(Nz([lbSearchProduct]))>0;[tblOrders]![еProductCode];IIf([obProducts]=2 And Len(Nz([lbSearchProduct]))>0;[tblOrders]![fProductCode];IIf([obProducts]=3 And Len(Nz([lbSearchProduct]))>0;[tblOrders]![kProductCode])))
And in criteria for that row I set the list box that has the bound column for product code lbAllProducts