What actually high and low means in a ranges table [closed] - range

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
The range table contains the high and a low value. What it actually does and used for?

the range table can be used in open sql queries (using the IN clause) as a restriction. You can define several ranges to include or exclude in your query result. For instance:
report ZZTEST.
types:
lt_kunrng type range of kunnr_d.
data:
it_rnrng type standard table of lt_kunrng,
wa_rnrng type lt_kunrng,
it_kna1 type standard table of kna1.
START-OF-SELECTION.
move:
'I' to wa_rnrng-sign,
'EQ' to wa_rnrng-option,
'0001000000' to wa_rnrng-low,
'0002999999' to wa_rnrng-high.
append wa_rnrng to it_rnrng.
move:
'I' to wa_rnrng-sign,
'EQ' to wa_rnrng-option,
'0003500000' to wa_rnrng-low,
append wa_rnrng to it_rnrng.
select * from kna1 into corresponding fields of table it_kna1
where kna1~kunnr in it_rnrng.
this example defines a RANGE table manually, adds two rows to it and then queries transparent table KNA1 with this range table. The internal table it_kna1 should then contain all KNA1 records with KUNNR between 1000000 and 2999999 and the record with KUNNR 35000000. So you can combine several ranges in a single range table.
The field SIGN contains either 'I' for Include or 'E' for Exclude (meaning that this row should include or exclude records matching the defined range), the field OPTION defines the comparer ('EQ' for equal, 'GT' for greater than, 'GE' for greater or equal and so forth). Fields HIGH and LOW contain the actual ranges. If you only want to query a single value you don't have to supply both LOW and HIGH, you only need to supply field LOW (and of course SIGN and OPTION).
RANGE table are also created when you define a SELECT-OPTION in a report. Users can then use the selection screen to define the ranges they want to use in the report.
REPORT ZZTEST.
TABLES: kna1.
DATA: it_kna1 type standard table of kna1.
SELECT-OPTION:
so_kndrng for kna1-kunnr.
START-OF-SELECTION.
select * from kna1 into corresponding fields of it_kna1
where kna1~kunnr in so_kndrng.
For further information regarding range tables you can also refer to the official documentation here

Related

Dynamically render multiple columns based on a drop-down list

I have a table in tableau with say 4 columns (Say Employee ID, Name, Address, Email).
I want to provide the users an option to select single/multiple columns from a drop down list (assume in the drop down list we have columns headers, Customfield1, Customfield2.....,Customfield10) which would be added to the table as a separate columns.
Say for Instance if the user selects CustomField1, CustomField2, CustomField3 from the drop-down list then the table should have in total of 7 columns (4 Emp fields + 3 Custom Fields)
Though I stated a simple requirement, my idea was to extrapolate that to something complex.
I think some version of this could be done, albeit in a hacky way. What you're looking for is 'Dynamic Parameters.' They don't technically officially exist in the product, but can be created with the combination of parameter and calculated field.
Here is a link to a method on such creation.
The idea here would be to re-order columns in a custom manner. Each calculated field would have to have its own logic for which dimension it was to display when a user selected a parameter. (ie: With parameter selection A Column 1 goes to [Name] and Column 2 goes to [Address], and with parameter selection B Column 1 goes to [Address] and Column 2 goes to [Name].) The caveat here is that each potential layout would need to have the same number of columns - there is not a way to add columns dynamically. Consider that each column is represented here with a calculated field.
Good luck on it.

How to extract just the IN count of a Tableau set

How can I extract the IN count portion of a Tableau set? I can see the IN/OUT counts when I drop the set into Text but can't figure out how to get at the IN value by itself.
Ultimately, I want to create a Pie Chart of three sets with just the IN counts as the measures.
I am using Tableau Public if that is a factor.
You have to be a little careful about specifying what you wish to count.
One way to think of a set is as a Boolean function that gives a value to each data record denoting whether that record is associated with the set.
Another way to think of a set is as a mathematical set whose members are a subset of the values for some discrete field. (Or Tuple of fields)
The difference between the two views is really just a mindset, whether you consider the set as a Boolean function whose domain is a data row in the data source, or whose domain is the field on which the set definition is based.
Say you are looking at Tableau’s Superstore data set where each data record is a line item for a product attached to an order.
If your set is based on the field Region, say its called [My Favorite Regions] and currently contains {“East”, “Central”} do you want your count to be 2 (i.e. the number of regions in the set) ? Or do you want your count to be in the tens of thousands (i.e the number of line items on orders from the regions in the set)? Or something in between, maybe the number of distinct orders (i.e. order ids) within the selected regions...
If you want to count data rows that are associated with the set, you can simply filter by the set and calculate SUM([Number of Records[). If you want to count the regions in the set even though the level of detail of the data is at the order line item level,then you’ll have to use either a COUNTD to count the distinct regions, or some approach to specify what it is you want Tableau to count.
For example, put your set on the filter shelf, and show COUNTD(Region) which could be slow for very large data sets. To get the same effect without an explicit filter, you can define a LOD calculation such as:
{ COUNTD(if [My Favorite Regions] then [Region] end) }
Or you could use a table calc with the SIZE() function to do the calculation in the Tableau client instead of by the data source.
Not sure what your data looks like but you could set a certain condition when creating a set or split the IN/OUT into two different sets.
Here's a link to sets in Tableau.
You can do this with an if statement
IF [set] = TRUE THEN 1 ELSE 0 END
Then I suppose you could sum this calculated field
The most common usage is when you have a lot of categories and want to create an 'Other' category based on the categories that aren't in a set, if the set is a "Top N Set"
To do this:
IF [set] = TRUE THEN [dimension] ELSE 'Others' END

Ruby on Rails 4 editing multiple records integers at once

I have a question regarding editing multiple records of a model on the same form.
Thus far through my research I have seen Boolean changed and functions applied to record values. However, i have yet to see the ability to change integers in selected records to any value a user desires.
Basically, I wish to create a table listing the id, integer value and last edit time that gives the user the ability to change any/all of the integer values on submission to value they entered into the form (i.e. Edit Multiple).
Thanks

How to change the value of heading columns based on a parameter

I created a report where I want to show the heading of a column based on a parameter. I tried using both table and matrix format, but I'm unable to reduce year.
year=2013
For example if I choose 2013 in the report this means it will show the last 10 years in the repor, i.e. 2013,2012,2011,2010,2009,2008, up until 2002.
If I understand your question correctly you want to query a database and display the results in a table with a column per year. You can do this by using by using a Matrix object and Column Groups
Add your Matrix object by drag and dropping. Select the Column Group | Group Properties and add a Group Expression.
Use the following code as your Group Expression.
=Year(Fields!Date.Value)
Two fold I'd think:
Alter your sql to accept the parameter and get the bast 10 years in column names 1, 2, etc.
Then use an expression in the header or title similar to =#Parameter!par.Value - Cdec(Data!1.Value) to show headers for 2013 to 2002.
I hope I was clear?

Dynamic Columns [duplicate]

This question already has answers here:
How to show/hide a column at runtime?
(8 answers)
Closed 5 years ago.
I need to create a report where the number of columns changes based on the data being passed to iReport just like with a subreport. Is there a way to do this?
I agree with Ischin's answer, but I will elaborate.
The Crosstab Report will allow you to have dynamic columns because it allows you to pivot your data. You can select one or more fields to group by to create the columns. The values of the groups become the labels for the columns and then you must use aggregate functions for the values in the report called Measures (e.g., sum or count). If you select more than one field, you will have multiple levels of columns. When you design the report, you pick the size of the columns--they must all have the same size.
JasperReports is a product designed for creating something that will print on a piece of paper consistently, like a PDF. iReport as of at least version 5.1.0, does not have any other way to truly dynamically create columns. You could write in logic to show or hide columns based on parameters, but this would be very tedious and does not fit in with what JasperReports is designed for. It would be very difficult, for example, to allow the user running the report to select parameters that allow the user to control which columns are in the report and the positions of the columns.