Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
how to add two columns in table. What's the right expression in this case.
Be informed that I have two dataset (Extra Deduction, Checklist), these two dataset has numeric column value, how to add these two columns with different dataset.
these steps I did (may it help):-
Open Visual Studio - New Project - in Business Intelligence section I chose Reporting Service.
Then right click on Reports folder then I chose "Add new report".
Then in Report Wizard I set Data Source name "DataSource1" and chose "Microsoft Dynamics CRM Fetch" connection type.
In Query Builder I put the XML query to bring the data that I want, it's contains two columns (Reference Number, Deduction value), dataset name is (DedctionDS).
Then I added one more columns in the table to get another value from another dataset.
Then I made the second dataset called (ChkListDS) with XML query to bring two columns (Reference Number, Checklist value).
In the new column in table, I made an expression to bring the value from other dataset, the expression is ( =Lookup(Fields!DedctionRefNo.Value, Fields!ChkListRefNo.Value, Fields!ChecklistValue.Value, "ChkListDS") ).
Until now the data are perfect, but I need now to make Summation between (Deduction value) and (Checklist value), which they're in different dataset .
Please see the below picture to know what i'm trying to do .
I hope I explained it very well .
Any help in this regard will be highly appreciated.
Thanks ..
If it were the same source of data (preferably SQL Server), I would advise you to use SQL join to create one dataset. However, it seems that there is a problem with that, so you have to user another strategy.
What I have seen in another project (not my code) is that you can use one datasource as the main one, and for each row of that datasource look for the matching rows in another one. This requires Lookup() function in SSRS, and you have obviously found that it is the way to correlate two datasets.
Only thing you have to do now is to get the number from the value you have received using the lookup function and add it to the column of your choice.
Your starting expression is:
= Lookup(
Fields!DedctionRefNo.Value,
Fields!ChkListRefNo.Value,
Fields!ChecklistValue.Value,
"ChkListDS")
To convert it to the decimal representation (I hope that is what you have in the database as source), you need CDec() function:
= CDec(Lookup(
Fields!DedctionRefNo.Value,
Fields!ChkListRefNo.Value,
Fields!ChecklistValue.Value,
"ChkListDS"))
And at last, you want to add it with your first value, like:
= CDec(Lookup(
Fields!DedctionRefNo.Value,
Fields!ChkListRefNo.Value,
Fields!ChecklistValue.Value,
"ChkListDS"))
+ Fields!{Your-deduction-value-field-name}
And if your-deduction-value-field in the database is not decimal, you have to cast it to decimal as well, using the same CDec() function.
Related
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 1 year ago.
Improve this question
I've created an Access report that is grouped by a person identifier and then displays all the rows in the source query related to that person identifier. I want to sort my report output by the person with the least number of rows to the person with the most number of rows. I can't use a GroupBy statement in the query because I have to display the detail records in the report. Hopefully this illustration helps.
Image shows a table with personid and multiple data columns.
When you say you can't use the GroupBy statement, does that mean you can't use the Total row in the Query Builder? (the reason I ask is because I've been able to achieve the same while still keeping the detail records)
So I made a replica of your table called tbl_people (and I added p# at the end of each field to make sure the data was going to the right area of the report) -close and save-
Then using the Query Builder, I added tbl_people and added PersonID TWICE.
Click the totals button towards the top; then change the first column from Group By to Count and make the Sort: Ascending (and I ended up naming it qry_count) -close and save-
Make a report, Right click on the square in the corner, click on Report Properties,
Go to either the Data or All tab and click on the little three dots to the right of Record Source
Add tbl_people and qry_count. Then drag PersonID from qry_count to PersonID in tbl_people creating an equal join. Then add ALL fields from tbl_people, click totals (at the top of the Query Builder), set ID Sort: Ascending. Then from qry_count add field CountofPersonID and make sure that is in the front of the query builder
On your report, add the fields (I added all of them from the table) then with the Sorting/Grouping (the same way you find the Report Properties) add a Group and add a textbox in the header and make the Control Source the CountOfPersonID. And that should do the trick! :)
I would like to custom the Report SSRS TaxReport_IT, I need to add a new field in order to use in to SyntethicReport Design.
(for example)
The classes involved seems these:
TaxReport_IT
TaxReportDP_IT
TaxReportController_IT
TaxReportContract_IT
Tables involved:
TmpTaxReport_ITSummary
TmpTaxReport_IT
TaxReportTmp_IT
Are there others? Are there some Queries involved?'
I added the new fields in to table _TmpTaxReport_IT_, and I pupulated the related tables
I'm sure, in to the method I pupulated correctly the new Field (I have the values that I expect), but when I print the Report I get a lower value. Seems like I don't take the total data set.
How can I add the new field and take the correctly total value?
I saved the data (about my custom field in a RegularTable) and the sum is correct, but I have mismatch when I print the report.
I think I skip some step to Report DataSet.
I use Dynamics AX 2012.
Thanks in advice!
I have an idea what could be wrong, but I'm making some assumptions. If they are not correct, please edit your question to clarify.
From your screenshot, it looks like you want to add your new custom field in the header section of the report design. I'm assuming the expression of that field looks similar to
=First(Fields!MyCustomFIELD.Value, "TaxReportDS_IT")
Note the First key word in that expression. This indicates that the value for that field should be taken from the first of the records of the report's dataset.
I'm assuming that you calculate the value of the field while the records in table TaxReportTmp_IT are being created so that each record has a different value. Maybe it is a sum of some other field, so the first record would have the smallest value and the last record the highest.
If all those assumptions are correct, you can fix this by changing the First keyword to Last. This indicates that you want to take the value of the last record of the report data set.
See also the documentation of the Last Function.
First time posting here so please be kind.
I've come from using PowerBI to achieve pretty much everything I need to with a couple of clicks to using SSRS 2008... and I'm having a hard time. Here's what I'm trying to do:
I have a main report that summarizes some data on how long it takes to close down help desk tickets. On that report I have a table with summary figures (ie 220 tickets were picked up after 5 working days, 18 tickets were reopened etc). I want to click the text-box that contains 220 and be taken to a drillthrough report that contain the same table with column headers and just different row sets in each case. There will be 8 drill through actions in total and I currently have 8 drill through reports. Only 2 of those are parameter based, the others just filter the dataset based on some conditions.
What I'm trying to work out is this: can my 8 drill-through reports be rolled into one, if they're just different views of the same dataset? I've created some calculated columns with values (Yes/No because boolean doesn't allow multiple values) which are easier to pass to parameters. I also have 8 parameters on my detail data set. I've set up actions (where parameter1 = yes for instance) to take me to my detail report and use the corresponding parameter each time. It should work... but it doesn't and I can't work out why. Currently its' complaining that I can't compare a boolean to an int16 - neither the value in my calculated column nor the default parameter value is boolean or int. So, am I trying to do something that just isn't possible? Has anyone else achieved this?
Edit: here's the parameter
The error I'm getting is
The calculated column that should be checked against the parameter is
=IIF(IsNothing(Fields!DatePickedUpByAgent.Value), "Yes", "No").
Here's how I defined the action to take me to the drill through report in this case
Here are the filters on the subreport dataset based on the parameters passed through from the main report. "NotYetPickedUpByAgent" is the example we've been discussing here. enter image description here
Could you please go through each of your parameters one by one.
I would suggest deleting all the filters and trying to run the report and subreport.
Then keep adding filter one by one.
I think issue can be any of the filter and not the one you think.
I have a bear of a problem here. The user wants a report that shows the earnings, deductions and liabilities (EDL) code of each employee or null/blank if an EDL code doesn't apply to that employee. I needed one row for each employee name and columns for each possible EDL code combination. I got that answer fixed from my previous question here:
Struggling with a dynamic pivot on multiple columns with one being concatenated
I ran into a problem where there are a potential 270 column headings (EDL code combination with "subj", "elig" or "amt" appended) but not every employee will have a value for every column and security settings lock me out of seeing 1 of the 3 payroll groups. This made my report very limited in that when I ran it I could only show on the Crystal Report the data for what columns I had at the time I created the Crystal Report. Well, the user who requested this report has access to payroll group 1 and if even one of those employees had an EDL code that I didn't have in my data when I created the Crystal Reports file then the report wasn't useful to the user. We figured a way for her to get the info she needed by her logging into SQL Server and executing the stored procedure and she did what she needed to do with the data.
Fast forwarding to today I have to create this as a report in SSRS or give detailed instructions on how she can do this in the future if need be since my contract is coming to an end. I'm not familiar with SSRS but I thought maybe that would meet her needs over Crystal Reports. However, I'm running into the same problem. When I add the stored procedure as a dataset (adding it in as text to execute, not clicking the stored procedure radio button) I only see the EDL codes from that particular query not all potential combinations. I need a way to maybe dynamically add columns to the SSRS report, does such a thing exist?
I am working with a matrix report in ssrs.
Here is a sample screenshot of my report extracted in excel
The report is simple enough. It shows the data for different years (example : AS OF JAN,2012).
The netrevenue for the years are defined in the database so they are fetched accordingly. The problem is with the other sub columns. Like the "%Change" column.
The column value is calculated with the help of following formula
%change = ((NetRevenue of The current year / NetRevenue of the last year) - 1) * 100
Now what I doing to solve this problem is calculate the values using sql queries for every column and then binding it directly to the control.
My question is that is there a simpler way to do this. I mean like in table control I can access the value of a cell by using
ReportItems!Textbox1.Value
Is there a way I can access the dynamic columns of the matrix report. Like accessing the netRevenue values for different years.
If more clarification is needed for the question then please ask.
Thanks in advance.
I believe the only issue your going to have is getting the revenue at the past year?
In this case you'll need to calculate the last years revenue in the sql. Then use:
=((RpItems!NetRev.Value / RpItems!NetRev_LastYr.Value) - 1) * 100
With this case you'll need to calculate all the last years values for the % changes you want to calculate.
Can I suggest you look into this and raise another question with the sql you currently have?
I've found this works best.