How to get row count when use group in BIRT - birt

I have a table which has group and group related item .
i need to count all rows which include all group and all group related item.
Any comment is welcome !!
Thanks

Related

PowerBI - Lookup by Multiple Criteria

I'm a new PBI user and would like help on the following:
I have 2 tables (Table 1 & 2). Table 1 is a bookings report showing sales orders, part numbers and order value. Table 2 is a margin report showing sales orders, part numbers with additional descriptive text and margin value.
I would like to copy margin values from Table 2 into a new column in Table 1 by looking up by sales order and part number.
Any help would be appreciated!
Tables1
Extract text using the LEFT function
Use the COMBINEVALUES function to create new column in each table. The new column will merge two existing old columns.
Depending if you have unique values in the lookup table, use LOOKUPVALUE function, if not, use this approach: DAX lookup first non blank value in unrelated table

Custom column to sum values from second table with conditional statement

I have two tables, the first table has a list of invoice numbers and the second table has a list of products associated with each invoice. I want to sum the total cost of the products for each invoice and include it in the first table using Excel Power Query.
Table 1
[InvoiceNumbers] [OtherData]
Table 2
[Product] [Amount] [InvoiceNumber]
List.Sum() seems to be the function I need to use, but I cannot filter table 2 by invoice number using this function
Table.SelectRows() can be used to select the second table, and filter it to a specific set of rows, but I cannot seem to filter the rows of Table 2 using a column from Table 1.
I have also looked into Grouping and joining the table, but because of other factors I have left out, this is not going to work.
The full query Im working with looks like this.
List.Sum(Table.SelectRows(Table2, each [InvoiceNumber] = [InvoiceNumber])[Amount])
This just returns the sum of all the rows because [InvoiceNumber] is equal to itself.
How can I reference the Invoice Number of the row in Table 1 to use it as a condition in the Table.SelectRows() function? Or is there a better way to get the data sum the from Table 2?
Table 1 Final
[InvoiceNumber] [OtherData] [SumOfAmounts]
If there is a restriction to group the invoice details table, you could just reference it, and group the reference
1) Reference the table:
2) Group the referenced table:
3) Then merge the reference table and expand the total column
If this helps please remember to mark the answer

How to visible only the last row of a row group of a table in ssrs report

I have a table in SSRS report. And I need to display only the last row of the table. ie,
How can I do this?
How do I select last 5 rows in a table without sorting? see this post, and change to "-1"
We can select the last row of the table by using Last() method.
For eg. if we have a table called Test then,
Last(Fields!Test.value);

Sorting a table using a subrepot column in SSRS. Is this possible?

I'm using SSRS 2005. I've got a table with various inventory data. In one columns I've got a subreport that is designed to pull the date of the most recent Purchase Order based upon the product code of whichever row the subreport is in. This would be fine, however I'm now being asked to be able to sort by this date column. My assumption is that you cannot sort a column with a subreport in it, but I thought I'd ask. Is there any way to do this?
You can include the most recent purchase order value in your main report's dataset as a subquery like this:
SELECT *
,(SELECT TOP 1 PurchaseOrder
FROM Purchasing p
WHERE p.ProductCode = i.ProductCode
ORDER BY PurchaseDate DESC
) as LastPurchaseOrder
FROM Inventory
Then you can use that value to sort your table.

How do I select only rows that don't have a corresponding foreign key in another table in MySQL?

I have 3 tables:
listing
photo
calendar
"photo" and "calendar" both have a "listing_id" column in them and every "listing" has a "photo". But I only want to select rows that have no entry in the "calendar" table with the matching "listing_id".
I'm not sure if I'm saying it correctly, but any help would be greatly appreciated. And if someone could show me CodeIgniter syntax, that'd be even better.
This will produce the list of calendar.free_date values that should not be returned because their associated listing_id values do not exist in the listing table.
select free_date from calendar c
where not exists (select * from listing
where listing_id = c.listing_id);
Should work as an SQL query. Not sure about CI syntax. Sorry!
SELECT * FROM listing WHERE listing_id NOT IN (SELECT listing_id FROM calendar)

Resources