SSRS - Expression not working after putting Subreport - sql

I have trouble regarding expression.
I have a report that has a calendar style. (Screenshot below)
I have an expression on the Day Number on the top left of the calendar cell, and it works (Which is in the top box).
Here is the expression :
=IIf(IsNothing(Fields!DayNumberOfMonth.Value), " ", Fields!DayNumberOfMonth.Value)
But when I added my sub-report which returns the list of employees and their schedule per date, the Expression is not working anymore. Some random number appears on the top left of the box, which is supposed to be blank. (Screenshot below)
Here is the Design View :
Any solutions or suggestions? Thank you in advance, I will appreciate it very much.

Is it possible that your week number from your subreport is not correctly aligning with the main report. It looks like it is using the number 7 from the next Sunday.

I figured it out. I set the visibility to "Show or hide based on an expression, then set the expression to : =IIf(IsNothing(Fields!empName.Value), True, False)

Related

Why is the output for my datediff expression to return a number of days bracketed?

I have written the following expression to give me the number of days between a date and today.
=IIF(Fields!First_Check_Start_Date.Value = nothing,nothing,datediff("d",Today,Fields!First_Check_Start_Date.Value))
The output is correct but is bracketing the number
ie. (292) instead of 292
Any help as to why this is
if you are using text box to display your result, check what is the type of your text box. Make it as number and look for it's format and set to correct
Else you could also format like below
=IIF(Fields!First_Check_Start_Date.Value = nothing,nothing,Format(datediff("d",Today,Fields!First_Check_Start_Date.Value),"##"))
So it appears that whilst viewing in SSRS Report builder the numbers are bracketed (292), however once export to either csv or excel the bracket disappears and is replaced bi a minus -292 which is correct
Thanks

Qlikview expression for percentage of bar (not total) in stacked bar chart

New to Qlikview, not yet familiar with scripting.
My data has two dimensions, Month and HSETimes (4 categories), and the expression is Count(HSETimes). A stacked bar chart using relative values returns the percentage of the total by month by category.
I need an expression to return each months total as 100% with each category proportionately represented to produce a bar chart similar to the attached image, but I do not know how to write the expression: have tried many combinations of subset and total to no avail. Should be simple: can anyone help? ChartSample
Using the relative checkbox on a bar chart rarely results in the desired output. To accomplish what you want, uncheck the "Relative" checkbox, and modify your expression to explicitly calculate the percentage you want.
Dimensions: Month, Category
Expression: count(HSETimes) / count(total<Month> HSETimes)
Using total<Month> is part of the set modifier syntax and will result in your denominator being the total per month while your numerator will still be the count for each month and category.
Also, ensure you have the "stacked" bar type selected in the "style" menu and set your number format in the "Number" menu to show in percent.
See here for more info on set modifiers. Or you can google 'set analysis', 'total modifier', 'set modifiers' and that should help you find more info.

Selected Dimension Value in Expression in QlikView

Just wondering how to get a selected value in an expression. I have the following bar chart, with drill down from Year to months.
When I click say 2011 bar I get the following chart.
Now is there a way to get Transported Mail - 2011 in the second chart instead of just plain Transported Mail. Note that 2011 is the current selected year. I want it to be incorporated in the label expression. Please guide.
You can use set analysis for this...
Try this:
= 'Transported Mail -' & concat({state_name} DISTINCT year_var,',')
Note If you haven't created any alternate states, you can use $ as your state_name
Now, you can get much more complicated with this to allow it to handle multiple years differently, but this should do the trick for you.

Remove commas in group tree

I created a report in a VB.Net application and I'm using the Crystal Reports Viewer control to display it. The report is grouped by a field that's an integer datatype. I've been successful in formatting the field to a string so that it displays properly on the report (i.e., without any thousdand separators or decimals).
The problem now is that when I open the Group Tree in the viewer, the field is being treated as an integer (with the thousand separators). I've attempting following the solutions in these articles article1, article2, article3, but they only address formatting the display of the field (which I'm not having a problem with).
So how to I format the display of an integer as string on the Group Tree, not the report itself?
Go into the Group Expert, select your group, and hit "Options". Select the "Options" tab, and then mark the checkbox that says "Customize Group Name Field" and then select "Use Formula as Group Name" and finally enter the formula totext({table.field_you_are_grouping_on},0,'') This will change group's appearance everywhere, including in the tree.
Note that the second parameter to totext controls the number of decimals and the third parameter controls the thousands-separator (empty string, in our case).
Create a formula for the group like this:
ToText({table.field},0).
It will remove any thousands separators. I use this all the time.

How to generate report

I have problem in generate report. I use crystal report 8.5 with vb.net 2008,what I want is when I generate report it will appear red value, if the value is more or less than actual value else it will give default value but when I put this code it give me wrong result
If {Intake.wheatType} = {Spec.WheatType} AND
{Intake.HB43} >={Spec.M_Min} AND{Intake.HB43} >={Spec.M_Max} Then
Red
Else
DefaultAttribute
this report is related with two tables, which is table Spec and table Intake. Could anyone help/teach me how to fix this problem
When determining whether a value is between a minimum and maximum, the logic will be:
Is the value greater than the minimum and is the value less than the maximum?
Actually you can create a Formula Field for that,
From Field Explorer, right click Formula Field
A popup window will appear, type the name of the formula you want.
in the Formula Editor insert you custome formula
Code:
If {Intake.wheatType} = {Spec.WheatType} AND {Intake.HB43} >={Spec.M_Min} AND {Intake.HB43} >={Spec.M_Max} Then
Red
Else
DefaultAttribute
Then click OK. Drag the newly created field on your report. And that's it.
For more info, see this: Adding Formula Field