In Tableau, Is it possible to give Column number in Column Shelf - tableau-api

I'm using Tableau. So, instead of giving the [Column_name], Is it possible to give [Column_number] in column shelf?
- Hariharasudhan. R.

No -- for good reason.
Think of the data source as a template for a potential SQL (or MDX or TQL) query; specifying tables, joins, unions and possibly some where/having clauses for data source filters.
The actual SQL generated for any particular view will be an (optimized) query that only selects columns that are actually needed for that particular view, adds where/having clauses based on the filters being used etc.
So a column doesn't have a fixed number. The same column may be the first field selected in one situation, the last field in another situation, and left off completely in another.

If you want to change the name of column shelf:
Create a duplicate of variable and change original with duplicates and assign name as your wish by right-click on Edit Aliases and change as per your requirement.

Go to Data Source
On the middle right corner check on Show aliases
Go to column and right click on it. Go to Rename

Related

How do I group dates in IBM COGNOS when building a front end dashboard

I am an extreme newbie to COGNOS (5 days give or take a few hrs) and have been thrown in the deep end.
I have a data package i am working with and the only date field I can use has the property of timestamp. I have looked through other questions that are similar and i have used the "CAST" function to turn the field into a date so this has worked.
cast ( [TR_Logical Layer].[Fact Event].[Period Datetime],DATE) - so I was happy with that.
However now when I am building the graph, I am getting repeated dates - and I can only think that this is because somehow it is still holding onto the timestamp portion of the field.
Please how can i get all of my many dates for say the 21st Jul to be one?
Possible issue: Repeating is probably due to how it is grouped (down to the time which would have the day repeating)
Suggested solution: Add a determinant to control granularity and grouping
Here are the steps
https://www.ibm.com/docs/en/cognos-analytics/11.1.0?topic=determinants-specifying
Click the query subject you want, and click Actions, Edit Definition.
Click the Determinants tab.
Click Add under the Determinants box.
The entry New Determinant displays in the box. To give this entry a meaningful name, right-click it, and click Rename.
To define a key, right-click a query item in the Available items box and click Add as Key. Tip: You can also drag query items to the Key box.
To identify which query items should be associated with this determinant, right-click query items in the Available items box, and click Add as Attributes.
Tip: You can also drag query items to the Attributes box.
You can have a determinant with no attributes defined for it. Framework Manager uses this type of determinant to indicate which query items are indexed.
To specify that the selected determinant should be used as the unique identifier, select the Uniquely Identified check box.
Do this only if the data in this item is unique for every row in the underlying data source. You can specify more than one unique determinant if they are truly unique. At query time, the relationship being used will determine which unique determinant to use.
Select the Group By check box to indicate that when keys or attributes associated with that determinant are repeated in the data, IBM® Cognos® Analytics should apply aggregate functions and grouping to avoid double-counting.
If you want to change the order of the determinants, use the arrow buttons.
Determinants are processed in the order in which they are specified in the model.
Click OK

Group by first two characters of column, in Tableau?

I'm using Tableau Desktop v9.0. I have data that looks like this:
code,items
02050252,7
03040620,19
03060423,3
I want to create a bar chart of the items grouped by the first two characters of the code field.
So effectively a chart that shows this underlying data:
new_code,items
02,7
03,22
Is it possible to do this within Tableau? Or do I need to group the data manually myself first?
You can definitely do this within Tableau.
Make sure that your code column is a string. If it's not, right click on it in the dimensions section and choose Change Data Type.
Then, create a calculated field (Analysis -> Create Calculated Field) and enter the expression LEFT([Code], 2), which will take the first two characters of the code field.
Drag your new_code field to the Rows shelf and Items to the Columns shelf and voila, you have your desired data. You can of course change the type of the chart, make it a table, etc. from here.

Hide duplicate row SSRS 2008 R2

Duplicated data is coming in my report because source table has duplicate data. Without creating group, I want to hide duplicate data writing expression. So what I did: I select table row and put a expression for hidden property of table row.
The expression was like =(Previous(Fields!ID.Value) = Fields!ID.Value)
but it did not work ... Still duplicate data is showing. So tell me how to suppress duplicate rows in ssrs writing expression not by grouping.
You probably should try these options first:
Try to clean the duplicate data at the source.
Change your source query so the duplicates don't appear in the dataset. (e.g. SELECT DISTINCT)
If not, on the row's Visibility Hidden property you can use the Previous function:
=iif(Fields!YourField.Value = Previous(Fields!YourField.Value), True, False)
You would have to sort on the YourField column for it to work.
I was putting the expression above also until I started using the "Hide Duplicates" line in the properties pane. You basically just select the row, in the dropdown choose your Dataset and that's it. any duplicates will be hidden. Also if you just want to hide certain textboxes duplicates you can do the same as i stated earlier except click on the textbox and not the row. Just another alternative, i'm aware you said using an expression.
You can do it using expression or "Hide Duplicates" options from cell or row properties.
Expressions :
=IIF(Fields!YourField.Value = Previous(Fields!YourField.Value), True, False)
Hide Duplicates Steps:
Select row or cell
Click on F4 key on your Keyboard
Look for "Hide Duplicates"
Choose your DataSet from the dropdownlist
Done, I hope that helps
As an alternative option, you can do it by setting row groups. In a report I was trying to create, the Hide Duplicates property wouldn't behave correctly because of using the same dataset multiple times in a list container.
All you need to do is set the row group properties for the default row group (rightclick the grey row header, and go to Row Group then Group Properties), and add Group expressions on the General tab. Add as many as you need for each field. It's like the Remove Duplicates tool in Microsoft Excel
Sometimes the Hide Duplicates option does apply to the report content. If you add a =Sum(Field!Field_Name.Value) sum around field in the cell, it suppresses the copy from previous record. Of course, strictly speaking this is a solution where the incoming data set has NULL rows for the cells with the issue.
Since the using of Previous function in SSRS compare to the only record previous to it, thus it might cause the duplicate of records still shown if the repeated records not next to each other.
Use the sorting on each table you apply the Previous function, it should resolve the "non next to each other" duplicate records as well.

In SSRS 2008, is there any way to add all dataset fields to a table at once?

I'm working with SSRS for the first time. When adding a table to a report, is there any way to add all fields of a dataset to it at once or does it have to be done individually? Drag & drop, insert column -> right is a pain when there are a lot of fields that are being displayed.
It's a bit of a workaround, but the "Add new report" wizard automatically creates a table with the specified columns and groups from your given dataset. I don't believe there's a way to trigger this functionality from within an existing report, but you could create a "sacrificial" report to get what you're looking for - run through the wizard, generate the table, and copy / paste it into your original report. As long as your datasets are the same, it should work just fine...
Hope this helps.
I have a similar problem as the op and am new to SSRS/BIDS. And, I am updating a previously created report which (for me) is too complex to just quickly re-create using the "wizard generation" as the datasource is a web service (with code-generated web service parameters, lots of calc'd datasource fields, etc). It is faster to just copy the .rdl, delete all, and create the table manually.
I thought I would add that (only a little better than op's method, but nonetheless it is time-saving) you can just drag and drop to populate columns w/o the "right click > insert column > right". Just drag the dataset field to the place you want it in the table and BIDS/SSRS will automatically insert a new column. It also helps to drag the latter columns first (i.e. always inserting a previous column) so you don't have to scroll to the right all the time.
I was looking for the similar thing and I have figured this out. Open your report in Report Builder 3.0 which is a free BI tool by Microsoft. Go to Insert > Table wizzard. Then just follow the wizard steps to generate auto columns. Save and reopen the file in your visual studio, file will refresh itself.
Ved
#Kevin Fisher actually there is no need a workaround. There is way to do this out of the box of Report Builder 3. Open your existing favorite report template. on the tool bar, click on INSERT tab, look for TABLE icon, click on the down-ward arrow at the bottom of the TABLE icon, then choose TABLE WIZARD. Then I guess you know what to do from here. -hope this help.
I agree that there is no way to bring all of the columns over from the data set to a table easily. But I came up with a method that helped me:
Insert a blank table (this usually gives you 3 columns). Then insert columns to the right of the table (right click, Insert Column, To the Right), as many times as you need in order for it to equal the number of columns in your data set.
Once you have all the blank columns created in your table, click inside a table cell box and use the drop-down to select the field. This has the added benefit of allowing you to get the fields in the correct order, since I've noticed that the field names in the dataset don't always appear in the same order as the SQL stored proc output.

Is it possible to create a row that spans all columns of a Matrix in SSRS 2008?

Is it possible to have add a row to an SSRS 2008 Matrix that spans all of the matrix's columns?
This crude diagram shows roughly what I'm looking for:
The basic idea is that each line item is a person, and each column is a field in a form for that person. The fields themselves are dynamic (and implemented as column groups on the matrix). Additional column groups are included to append non-dynamic form fields, like the time the record was entered and who entered it. Under each person's record is a comments field, which should span all of the form fields above it.
At the moment I have the matrix embedded in another tablix, with the name and fields in the matrix and the comments in the parent tablix. This works for the data (each instance of the matrix ends up being one row), but the header repeats too often (once per person) because it's attached to the matrix. The only thought I have as to how to fix this is to create another matrix in the parent tablix with the same grouping and use it to display the headers... But this will require quite a lot of manual synchronization to keep the two matrices the same.
Edit: The key problem here is making the second row span multiple column groups.
Here's what you can do:
Select the column grouping you want to add above and right click and select
Add Group... Parent Group...
Group the column by something that will not aggregate the data. You'll have to select a field from your dataset to group by so that it creates an overlapping column grouping.
Check the Add group header box
You should now see something similar to this:
Now you just need to move the Value1 field and it's header over under the new column to the right beyond the matrix dividers. Once that's done, simply delete the ungrouped column where you just copied Value1 from and be sure to select Delete columns only checkbox.
Your finished product should look like this:
It is possible - And the above answers are partial answers leaving out one key step: Merging the cells of the child row.
First, right click on your grouped row, then select Insert Row -> Inside Group - Below and you will get two rows with the cells aligning on the columns
Second, ctrl click all the cells in your new row (ie row without the data) then right click on one of the highlighted cells, and then select Merge Cells.
Now you have the table you like. To add a value to the new row: first right click your new (multi column) cell,select Create Placeholder, and then add the dataset item you desire to the placeholder.
[Edit]
After several attempts, I'm going to say this isn't possible in SSRS. The best I could come up with is a group footer that spans columns 1,2, and 3, but not the User column.
[Original Response]
I recently did something similar to this.
First, what tool are you using to create SSRS reports? (I used SQL Server Business Intelligence Development Studio)
You'll want to create a row group (grouped on Person)
Append a row to your table in "Design" view (Right click, "Insert Row --> Inside Group - Below").
Add an expression to the row that pulls the value for your "Comment" column (=Fields!Comment.Value).
Let me know if that helps...
Try adding in you column group "header" with a grouping expression of (1=1). Then a detail field will need to be defined. If you define the other group with correct data then the "header" will stretch across all details columns. You may need to merger depending on other options.
The easiest way to do this is to create a Tablix with only one column, and your row grouping.
Then, you create two rows inside this group.
In the first row inside the group, you insert a Matrix, wich you can then subgroup as you prefer.
I just had a similar problem, and this was my solution.
I banged my head against the wall for a lot of time, until i realized the solution to my problem wasn't "making a cell span multiple column groups", but "making a cell split into multiple column groups".
You can accomplish the goal by using a subreport for each person. The subreport will receive the employee id and create the hierarchy for you. Make sure your subreport column widths match the widths of the parent report.