I have a data set that looks like this:
I want to use a parameter to select a value from Group and then compute Ratio which is Value divided by Value when Group == parameter. The image above is the desired output when the parameter equals D.
I thought that this would do the trick:
[Value]/{EXCLUDE [GROUP]: MAX(VALUE)}
But I just get nulls.
Thanks for your help!
LOD expressions dont work that way and they will always show as null values in the datasource page. Here is the Documentation. (Bullet point 2)
For your case, create the parameter as shown below. (You can use 'Paste from clipboard' as by default only values can be assigned by field and not 'Display As'.)
Now your calculation simply becomes
[Value]/[Selected_Group]
I have a bound form that has roughly 8 text boxes on it. I am in some instances needing to subtract the value from textbox2 from the value in textbox1. For example, my set-up is like so:
lblProfit lblOTBilled
txtProfit txtOTBilled
txtProfit is where the profit amount would be input, BUT if there is any OT billed, then I would need to use this formula
txtProfit = txtProfit - txtOTBilled
My issue is that both txtProfit and txtOTBilled are bound fields so I am not quite sure how to go about setting this up.
In Access 2013 how would I do something like this?
You will need an additional textbox:
txtProfitCalculated
and control source for this:
=[txtProfit]-Nz([txtOTBilled],0)
I'm having problem with JasperReports report by getting sum of two fields.
I have created so far variables that holds fields "TareWeight" variable that is casting values from double to float
new Float($F{EquipmentTareWeightKg})
"CargoWt" variable that is casting from string to float, etc...
Float.parseFloat($F{UfvFlexString03})+Float.parseFloat($F{UfvFlexString04})
So now I have two variables which I can manipulate with.
The problem starts when I wish to do a "recap" using crosstab. I have setup two groups that is done with wizard, and added another in crosstab. (please refer to the printscreen below)
And now, I have created under measures SumOf Tare that is using variable TareWt, and SumOfCargoWt that is using variable CargoWt.
I have tried to create another Measure SumOfGrossWt that would do a sum of variables TareWt + CargoWt but I have got some nonsense values.
I have tried to do another approach by creating variable GrossWt that would basically do exact the same thing as previous attempt
$V{Tare}+$V{CargoWt}
or use an variable: GrossWt
$V{Tare}+$V{CargoWt} or new Float($F{EquipmentTareWeightKg})+(Float.parseFloat($F{UfvFlexString03})+Float.parseFloat($F{UfvFlexString04}))
None of these actually worked: (Sum should be done by "Sum Of Tare"+ "Sum of CargoWt" = "Sum of GrossWt") plese refer to the second picture.
Here is a complete jrxml code/file:
jrxml file
save it as *.jrxml
Can please someone help me find a solution? how can I sum those two measure fields and get correct values?
Since CargoWt field had some null values in database, addition float value with null is equal to null, so the only value which was displayed on report are the one that had values for CargoWt, all others with null value were "ignored".
This is the link of my visualization: My dashboard
In the tab "Cursos por ciclo", I would like to know how to remove the option "PTJE.TOTAL" from the filter "CURSO".
You can do this by creating a new calculated field.
Right click on CURSO and select "create calculated field" then use this formula:
IF left([CURSO], 4) <> "PTJE" THEN [CURSO] END
Basically, this means: if the value does not start with "PTJE" then include it.
Then use the new calculated field as a filter, you will see that it does not include the "PTJE. TOTAL" value (it has been replaced with nulls now). So when you apply a quick filter the "PTJE. TOTAL" value won't appear.
Note: Normally I'd use something simpler like:
IF [CURSO] <> "PTJE. TOTAL" THEN [CURSO] END
but that is not working with your data for some reason.
Also, you can read more about calculated fields in Tableau here:
http://onlinehelp.tableausoftware.com/v6.1/public/online/en-us/i181523.html
I'm using SSRS 2008 R2 and building a report with Report Builder 3.0. I have 3 parameters that are all used to restrict my data from the same column, the diagnosis code. What my user needs is the ability to restrict up to three levels of potential matches.
For example, they want to be able to select all diagnosis LIKE "Z%" and have those displayed. They want to be able to select all diagnosis LIKE "Z%" and LIKE "W%" and have those displayed but NOT any of those that are ONLY LIKE "Z%". They also want to be able to select all diagnosis that are LIKE "Z%" and LIKE "W%" and LIKE "U%" but NOT those that are ONLY LIKE "Z%" or ONLY LIKE "Z%" and LIKE "W%".
This has proven to be extremely difficult, basically impossible in one SQL query. I tried using UNION but it was still limiting me. Currently, I have created 3 seperate datasets, DXCode1, DXCode 2 and DXCode3, each one connected to a different parameter, allowing the 2nd and 3rd parameters to be NULL. I've got 3 rows in a table on my report to display my diagnosis information. Diagnosis Code (DXCode1) row 1 shows anything LIKE Z%. Diagnosis Code (DXCode2) row 2 shows anything LIKE W% via LOOKUP to my second dataset. Diagnosis Code (DXCode3) row 3 shows anything LIKE U% via LOOKUP to my third dataset.
I have a hidden column in each row that checks the length of my possible matches.
=LEN(Lookup(Fields!ChartNumber.Value, Fields!ChartNumber.Value, Fields!DiagnosisCode.Value,"DXCode2"))
ChartNumber is my unique identifier. If there a match on those in DXCode1 and DXCode2, it means there's something I want to show. I use Row Visibility to hide any rows that have a value of 0. I repeat this logic on the next row down as well.
This works to do anything when they are looking for more than one type of diagnosis code. When they ONLY want diagnosis that are LIKE "Z%", I can't use the same logic or else it hides everything. I need something that will hide DXCode2 and DXCode3 if are NULL but will still allow me to hide DXCode1 only if it standing alone and still show my DXCode1, DXCode2 and DXCode3 if they match.
I hope that I have explained myself correctly and that someone can help with a solution.
Actually I got it. I used a text box first to show true or false on the report for all possible combinations. I used this statement:
=IIF(LEN(Lookup(Fields!ChartNumber.Value, Fields!ChartNumber.Value, Fields!DiagnosisCode.Value,"DXCode1"))>0,"True","False")+IIF(LEN(Lookup(Fields!ChartNumber.Value, Fields!ChartNumber.Value, Fields!DiagnosisCode.Value,"DXCode2"))>0,"True","False")+IIF(LEN(Lookup(Fields!ChartNumber.Value, Fields!ChartNumber.Value, Fields!DiagnosisCode.Value,"DXCode3"))>0,"True","False")
This told me if DXCode1 had a value and DXCode2 and DXCode3 did not, it was TrueFalseFalse
If DXCode1 and DXCode2 had a value and DXCode3 did not, it was TrueTrueFalse
If DXCode1 and DXCode2 and DXCode3 had a value, it was TrueTrueTrue
If DXCode1 and DXCode3 had a value and DXCode2 did not, it was TrueFalseTrue
I needed code on my first row visibility telling it if it was TrueFalseFalse and a parameter had been selected (LEN(Parameters!DiagnosisCode.Value)>0), I needed to hide it or if it was TrueFalseTrue and a parameter had been selected, I needed to hide it. That resulted in this code.
=((IIF(LEN(Lookup(Fields!ChartNumber.Value, Fields!ChartNumber.Value, Fields!DiagnosisCode.Value,"DXCode1"))>0,"True","False") + IIF(LEN(Lookup(Fields!ChartNumber.Value, Fields!ChartNumber.Value, Fields!DiagnosisCode.Value,"DXCode2"))>0,"True","False") + IIF(LEN(Lookup(Fields!ChartNumber.Value, Fields!ChartNumber.Value, Fields!DiagnosisCode.Value,"DXCode3"))>0,"True","False")) = "TrueFalseFalse" AND LEN(Parameters!DiagnosisCode2.Value) > 0) OR ((IIF(LEN(Lookup(Fields!ChartNumber.Value, Fields!ChartNumber.Value, Fields!DiagnosisCode.Value,"DXCode1"))>0,"True","False") + IIF(LEN(Lookup(Fields!ChartNumber.Value, Fields!ChartNumber.Value, Fields!DiagnosisCode.Value,"DXCode2"))>0,"True","False") + IIF(LEN(Lookup(Fields!ChartNumber.Value, Fields!ChartNumber.Value, Fields!DiagnosisCode.Value,"DXCode3"))>0,"True","False")) = "TrueFalseTrue"AND LEN(Parameters!DiagnosisCode2.Value) > 0)
I also ended up having to change the other rows to accomodate this same logic, The report now works.