SSRS 2008:How to hide a table row (Conditionally) based on category field - sql-server

I am new to Sql Server Reporting Services. I have created my following report.
I want to remove/hide rows of Brand Total whenever it does not exist in Brand list. Like in following picture i want to remove/hide "Ethnic Total" whereas "Ethnic" Brand does not exist in "Sample Store 1".
Similary i want to reomve/hide rows of "Outfitters Total" and "Junior Total" from Section Two whereas "Outfitters" and "Junior" don't exist in "Sample Store 2".
This is the structure of my report.
And following is the expression for Net Qty of a Single Brand total.
=Sum(IIf(Fields!Brand.Value = "Outfitters", Fields!Quantity.Value, Nothing))
What should i do?
What condition should i write in expression for Row Visibility?
Thanks in Advance for help.

i hope the below comments you are looking for.
Step 1: select that particular row (Outfitlers Total, Junior Total,Ethnic Total,Store Total)
One at a time and right click and select Row Visibility Option.
Step 2 :
A Dialog box appears with 3 options
1.Show
2.Hide
3. Show or hide based on expression
Select option 3 and copy the below expression in the Expression dialog box.
=iif((Sum(IIf(Fields!Brand.Value = "Outfitters", Fields!Quantity.Value, Nothing))) is nothing ,True,False)
i hope So this will be helpful.

=IIF(Fields!TotalRems.Value=0, True, False)
Replace TotalRems with your correct field name

You can do this way:
=IIF(Fields!YourField.Value like "YourValue",false,true)
Replace "YourField" with your own one and also change "YourValue" to whatever you need.
NB, " " or '' not treated as NOTHING,
For more explanation:
SSRS – Hide Rows in a Group based on a Value

another possibility for the hiding expression is, to use a text box reference. In place of "Textbox1" in the expression below, you can use the name of the text box, which is in the crossing of column "Net Qty" and row "Ethnic Total" (or one of the other total rows you mentioned)
=Iif(IsNothing(ReportItems!Textbox1.Value),True,False)

Related

Google Sheets: Trying to get values for Data in a column and row

Not sure I was able to explain myself too well in the title so here it goes:
I have been trying to figure this one out using the Filter function, but I am unable to make it work, and I am sure there must be an easy way to do it. The idea is that I have a column with the names of the members of a team, and each team member needs to perform a number of actions in a set of tasks. I am counting the amount of actions performed by each team member on each task, and trying to filter those by team member and by task.
So it goes like this: I have a list of names in column B. The number of actions in column C and the task would be selected from a dropdown menu done with 'Data validation'. When I select the task from my drop down menu, the number of actions would change to reflect the actions performed per agent on the selected task.
I added an example too. In the example I filtered the data in sheet 'Data' by names, but I don't know how to add a criteria that would also filter by the tasks on row 1 in the sheet 'Data', or if it is even possible.
Example: https://docs.google.com/spreadsheets/d/1PcdwNHDagfSmtF2Hl27YnrsAsPsF3A5OLuo2YcqGFdk/edit#gid=0
Thanks!
try:
=ARRAYFORMULA(IFNA(VLOOKUP(B2:B&C1,
SPLIT(FLATTEN(Data!A2:A&Data!B1:E1&"×"&Data!B2:E), "×"), 2, 0)))

How to query specific information from a JSON column?

I have searched Stack Overflow to get an answer to my question, but while I found many interesting cases, none of them quite address mine.
I have a column called fields in my data, that contains JSON information, such as presented below:
Row Fields
1 [{"label":"Label 1","key":"label_1","description":"Value of label_1"},{"label":"Label 2","key":"label_2","error":"Something"}]
2 [{"description":"something","label":"Row 1","key":"row_1"},{"label":"Row 2","message":"message_1","key":"row_2"}]
In essence, I have many rows of JSON that contain label and key, and bunch of other parameters like that. From every {}, I want to extract only label and key, and then (optional, but ideally) stretch every label and key in every {} to its own row. So, as a result, I would have the following output:
Row Label Key
1 Label 1 label_1
1 Label 2 label_2
2 Row 1 row_1
2 Row 2 row_2
Please note, contents of label and key within JSON can be anything (strings, integers, special characters, a mix of everything, etc. In addition, key and label can be anywhere in relation to other parameters within each {}.
Here is the Big Query SQL dummy data for convenience:
SELECT '1' AS Row, '[{"label":"Label 1","key":"label_1","description":"Value of label_1"},{"label":"Label 2","key":"label_2","error":"Something"}]' AS Fields
UNION ALL
SELECT '2' AS Row, '[{"description":"something","label":"Row 1","key":"row_1"},{"label":"Row 2","message":"message_1","key":"row_2"}]' AS Fields
I have first thought of using REGEX to isolate all the brackets and only show me information with label and key. Then, I looked into BQ Documentation of JSON functions and got very stuck on json_path parameters, specifically because their example doesn't match mine.
Consider below approach
select `row`,
json_extract_scalar(el, '$.label') label,
json_extract_scalar(el, '$.key') key
from your_table, unnest(json_extract_array(fields)) el
if applied to sample data in your question - output is

How do I set a conditional for a checkbox in an access report

so basically I am making a student database that contains student grades, I have a query that gives me a list of what classes a specific student has taken that are part of their major.
This is what the query returns:
Query result
So what I want to do is create a report that has a section like this where it lists all possible classes they can taken per that major:
Report
and I want to have a checkbox next to each class and have the box be checked off if they have taken the class, if they have not I want the box to be empty, so I don't necessarily need anything on the report like grades etc. I just want it checked off if they have taken that specific class . How can I go about this, lost on this part.
Although more information may be required to answer your question correctly, I'll give this a shot:
Assuming your the check box in question is called "Check1" and the table in question is called "Table1" and the field is called "Test" and the Report you mentioned is a form called "Report"... AND its only on the table when it has been completed.
Something to the effect of an "On Load" command into the form like:
If Not IsNull(DLookup("Class_UID", "Table1", "Class_UID = 'INF-202'")) Then
Forms("Report").Check1.Value = 1
End If
Of course, this would need to be added for each unique Class_UID
It's a simplistic way to do it, but far from the only option.

(VB2010 and ms Access) creating the query using INNERJOIN, select a field, and put the result as Display Member of combobox

before asking i wanna to show my tables and their relationships(created with ms access 2007)
here is the schema :
https://plus.google.com/photos/113802558354450440804/albums/5988059068393888337/5988059068667446962?banner=pwa&pid=5988059068667446962&oid=113802558354450440804
in this case, i create 3 combo boxes in VB2010 :
cbx_major(binded to MAJOR table)|major_id as the VALUE MEMBER, major_name as DISPLAY MEMBER
cbx_student(binded to STUDENT table)|student_id as the VALUE MEMBER, student_name as DISPLAY MEMBER
cbx_course( this is the question )
And here is the scenario :
first, i must choose what major is at cbx_major
second, the cbx_student will instruct the STUDENT table to select the student_name where major is equal to the selected value of cbx_major and set that query result as the DISPLAY MEMBER of cbx_student(this is done succesfuly without writing any code )
(this is the question)then the last, i want to set the cbx_course to display the course_name where student_id is equal to cbx_student.
i have done a lot of effort to do this :
i opened the combobox tasks menu and choose the student_course table and trying to create the query but it results "the schema returned by the new query differs from the base query"
i created the query in access by Joinning the table STUDENT_COURSE and COURSE using INNER JOIN then i bind the cbx_course to that query but it results wrong display.
i opened the xsd file then i create the query there but results wrong result
all those effort does not work.
i want to solve this case without writing code but using a technique such setting the taskbar menu, is it possible ? any idea? thanks so much for the attention

Google Refine Reconciliation: How to auto-replace with result text

Let's say I have cell like this:
"Nat. Taiwan Normal Univ., Taipei"
Once I do reconciliation, I get this:
Nat. Taiwan Normal Univ., Taipei
V V Create new topic
Search for match
Then I click on "Search for match" and get a drop down result:
"National Taiwan Normal University"
2 questions:
- How to I output the result text ("National Taiwan Normal University") in a separate or same column?
- Is it possible to output the country, which the result university is in, to a separate column?
Thank you!
The GREL expression cell.recon.match.name will get you the name. Put it in a separate column, so you don't lose the recon object.
Using "Add column from Freebase" will allow you to add the property /location/location/contained_by with a constraint of "type":"/location/country"

Resources