Getting sum from a dataset column - smartface.io

I want to get sum from a dataset column to a label. I have been trying it for a while but could not make it. So, it would be great if you can help me.

There is a link about datasets, you should check this. It will be helpful :
http://www.smartface.io/developer/guides/data-network/dataset-2/
You can reach the values in dataset such as:
myLabel.text = Data.myDataset.columnName;

Related

How to Sum two columns and merge it into one?

Right now my table is like:
But I want to show my table like:
I want to show the values in a single column for Shipment and Receipt, new to Qlikview so dont have any idea. Need guidance. Thanks in advance.
I think your problem is in the data model itself. 'Locked Trips S' is only referring to the 'Shipment' but has a value in 'Receipt' too. That shouldn't be a connection between these fields. Maybe provide a short screenshot of your data. That would help a lot :) !
And what about the 'Not Loaded Trips'? Where/How do you get it?
I would have commented this but I don't have the privilege :)
Problem solved, there is a column in database that contains the values - Shipment and Receipt,I used that column as dimension and removed null values with this calculated dimension:
=if([Transaction Type]<>' ',[Transaction Type])
and then in expression I wrote the expression =Count({}) as required.

Is it possible to sum the expression column in SSRS

I am stuck in a scenario where client needed to do sum of column which is containing calculated values(Expressions) which are calculated at the run-time (At the time of generating report).
I suggested client to calculate this column at database side and return this column to SSRS dataset but due to some circumstances it is not possible.
Any help on this will be greatly appreciated.
Thank You
I don't have comment access So Iam not able to ask you more details. You can SUM up the calculated expression in SSRS AS you didn't mention how it looks.I am getting one example.
If this is how your normal cell of calculation looks,
=Fields!FirstCol.Value+Fields!SecondCol.Value
Then the SUM can be
=SUM(Fields!FirstCol.Value)+SUM(Fields!SecondCol.Value)
And if you added the calulatedColumn in the Dataset itself then it becomes more simple as you just have to do as,
=SUM(Fields!CalculatedCol.Value)

How to calculate cumulative field values in report

I am new to JasperReports and iReport, and I am facing a problem. Before going through the question, first, please take a look at the following image:
So, the main problem is with the cumulative columns. Per say, the "Cumulative Bill" column should show the following values sequentially:
6000.0, 14000.0, 23000.0, 32800.0, 42800.0 and 45800.0
I have no idea how this can be done. I tried creating a new variable, but there is no cumulative type calculations there. Please assist me.
Create variable $V{variableName} with calculation = Sum and Variable expression = $F{BillAmountField} and put text field with this variable into detail section.
Is it so hard? :)
It can be done at the query level, here is the query :-
SELECT m.bill_amount,
#cbill:=#cbill+ifNull( m.bill_amount,0) cumulative_bill
FROM (
SELECT #cbill:=0,
bill_amount
FROM
)m

Sparkline based on Expression using custom code

I have an SSRS report which is reporting sales grouped by Month. One of the columns in this report is a calculated fields which takes 2 values and passes them to a custom code routine that is defined for this report. The textbox that is populated with the following code:
=Code.DivideBy(ReportItems!textbox21.Value, ReportItems!EarnedIncome1.Value)
All this Custom Code does is to divide the First Parameter by the Second Parameter (in this case whatever is in textbox21/EarnedIncome). The response is them shown on the screen as a percentage.
Below is an example of the report:
1 http://www.propelpos.com/images/screenshot002.jpg
This worked great. What we are trying to do now is to graphy the % that is in the BDX Loss ratio column which is figured out by the formula above (dividing Losses by Earned Premium)
When I try to copy the expression in the chart data and set the Category Groups to PeriodYearMonth (same as all the others), then I get a straight line.
I have no idea where to go next. Any ideas would be much appreciated.
I agree with #Neil. You can also Add the Calculated field in you data set properties. Take a look at the following screen. You can set the expression to calculate the data for your line chart.
Hope this helps!
I would suggest doing the calculation in your query and then using that computed column in SSRS. If you need help figuring out how to do that, let me know.

Finding ssrs matrix table coloumn values

I have a SSRS matrix table, which generates column dynamically. but i want to add some static coloumn in that report(added manually). but the static columns will have the same value as one of the dynamic column. All i want to do is, find the specific dynamic column (a column name with DynamicColoumn1) and show it in this static column
=IIF(Fields!DynamicColumnData.Value = "DynamicColoumn1",Fields!DynamicColumnDataValue.Value, "")
this works only for the first data in the DynamicColumnData, not working for other values in the DynamicColumnData. Anyone faced similar problem?
Try changing your formula to use the First dataset field only:
=IIF(First(Fields!DynamicColumnData.Value, "DataSet1") = "DynamicColoumn1",First(Fields!DynamicColumnDataValue.Value, "DataSet1"), "")
I did this way
=Sum(IIF(Fields!DynamicColumnData.Value = "DynamicColoumn1",
Fields!DynamicColumnDataValue.Value, 0))
Not sure this is the efficient way of doing, but worked for me.