How to show the numeric values of categorical labels in output using spss syntax - label

I was wondering whether there is a way to show the numeric values attached to the categories of a nominal variable when we create tables or frequencies in SPSS syntax.
I would like to use something similar to what the , nolab argument in stata does. It provides the numeric values of each category of the categorical variable (for example 1 for men and 0 for women).
I would like to create tables using SPSS Syntax (2-way tables or just frequencies) that show the nominal categories as well as the numeric values that SPSS has for each category. Does anybody know if this is possible with the table or frequencies command?

In SPSS you can choose in the settings wether label, the numerical values or both are shown in the output tables.
GUI
In the Menu choose Edit->Options and then the Output tab. There you can change the output settings under Pivot Table Labeling.
Syntax
Within Syntax Editor you can define the output settings with the "SET TNUMBERS" command.
SET TNUMBERS LABELS. /* Only Labels are shown in the output tables.
SET TNUMBERS VALUES. /* Only Values are shown in the output tables.
SET TNUMBERS BOTH. /* Values and Labels are shown in the output tables.
For more information see: SPSS Command Syntax Reference

Related

BIRT suppress multiple duplicate columns

I am working on a BIRT report. Its records are grouped on the basis of the status column. I was looking for an option in the Eclipse BIRT tool by which I can hide combinations of multiple columns in a row which are repeating. I have attached screenshots for both the current report and the expected report structure.
I tried the "suppress duplicate" option but that is limited to a single column. I am not able to apply this on multiple columns together. I couldn't figure out any other option. Please suggest any solution in the tool or do I need to change my query to return the result in the expected format?
Actual Result:
Expected Result:
There are three obvious ways to hide duplicate values.
All of these require you to configure this per column (BTW I don't understand why you consider this to be a problem).
As you already did: Use "suppress duplicates" at the column level.
Add more groups to your table after the existing group.
E.g. one group for the first column (whatever that is).
Then you can choose "Drop" "detail" in the properties of the corresponding group header cell. It's a bit difficult to get the layout right this way.
In your data set, if it's SQL, you can use a little construnct with CASE and the LAG analytic function to compare the column value to that of the previous row, and if they are equal, return NULL instead (pure SQL solution).

Is there a way in SSRS to highlight an interactively sorted column

I have a report with several interactive sort columns for sorting/ranking various metrics. I would like to highlight the column or even just the column header that is sorted. Is there a property that will tell me which column the report is sorted on?
I have not been able to find any threads that address this question.
No - there are no properties in SSRS to let the code know that the column is being sorted.
If you wanted to put in the effort, you could add a parameter with column names for the sorting. Then just set the table or Groups SORTING by your parameter using a Switch statement and the background color of the header and/or data cell(s) using an IIF for each column for the color.
SORT EXPRESSION:
=SWITCH(Parameters!SORTING.Value = "NAME", Fields!NAME.Value,
Parameters!SORTING.Value = "AGE", Fields!AGE.Value)
Background Color Expression for a NAME column:
=IIF(Parameters!SORTING.Value = "NAME", "Whitesmoke", "White")
For the other columns, just use the column name.
To be a little slicker, you could use the ACTION on the column header for each field to set the parameter and recall the report rather than forcing the user to hit View Report. You would Specify the same report but Add the SORTING parameter and hard code the columns name (which has to be the same as the SWITCH function).
Unfortunately, this would require the report to rerun each time the user wanted to sort.
Kinda lame but it's the only way that I can think of to do it.

OBIEE - Showing the Display Value from a Double Column / Presentation Variable

I have a double column laid out as so:
Display Value Code Column
Apr-17 201704
May-17 201705
Jun-17 201706
A 'between values' prompt is setup to show the Display Value and Filter by Column Code, and it's been given a presentation value.
So say I selected Apr-17 to Jun-17, the presentation value displays Apr-17,Jun-17 in the narrative, however I'd prefer it read like Apr-17 to Jun-17
I'm unable to use the SUBSTRING function in the narrative, so I decided to add the presentation value into a column and work from there.
However, once I add the presentation value the Column Formula, it displays the Code Column values instead of the Display Values, so:
201704,201706 instead of Apr-17,Jun-17
Is there a fix for this, or an alternative way of getting the desired formatting?
First of all your filtering seems extremely standard so I question your use of presentation variables in the first place.
If you just use out-of-the-box filter functionality with columns then you can just use the filters view.

show selected columns of table in QlikView

I am creating a Dashboard in QlikView, allowing the user to extract data based on the filters and selected columns. Requirments are below.
“Data Extract” table MUST be empty (even no column names are showed)at first!
Clicking the blue button shows the list of data available.
A table will then show those selected columns.
Does someone know how to do these?
Screenshot:
You need to set a conditional expression on each of your dimension and measures.
A simple example would be to have an ID for each measure, here the measure "NetSales" can be referenced by MeasureID "a".
Measure | MeasureID
NetSales | a
In the conditional expression for NetSales you can have:
=if(IsNull(GetFieldSelections(Measure)),0,SubStringCount(Concat(MeasureID, '|'), 'a'))
This will check the possible MeasureIDs and return 1 if NetSales is selected.
You need to create a "floating" tables with the dimensions & expressions you need to use in the table object:
Here is an example I made : https://ufile.io/j20am (just reload the file If you use personal edition)

Toad for Oracle bind variables with IN clause

I have a query that looks like this:
select * from foo where id in (:ids)
where the id column is a number.
When running this in TOAD version 11.0.0.116, I want to supply a list of ids so that the resulting query is:
select * from foo where id in (1,2,3)
The simple minded approach below gives an error that 1,2,3 is not a valid floating point value. Is there a type/value combination that will let me run the desired query?
CLARIFICATION: the query as shown is how it appears in my code, and I am pasting it into TOAD for testing the results of the query with various values. To date I have simply done a text replacement of the bind variable in TOAD with the comma separated list, and this works fine but is a bit annoying for trying different lists of values. Additionally, I have several queries of this form that I test in this way, so I was looking for a less pedestrian way to enter a list of values in TOAD without modifying the query. If this is not possible, I will continue with the pedestrian approach.
As indicated by OldProgrammer, the Gerrat's answer that "You can't use comma-separated values in one bind variable" in the indicated thread correctly answers this question as well.

Resources