- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Using a second column as value labels OR How to plot one variable and have another appear as label
Hi!
I have two x-variables:
Meeting.# is numeric ordinal (just the Row())
Meeting.ID is character nominal (can be date or some other text descriptor)
I need to plot attendance (X_2-X_8) against Meeting.# so that I can get a trend. But I want to display Meeting.ID as the x-axis labels.
I tried this approach: https://community.jmp.com/t5/Discussions/How-to-Add-Value-Labels-to-a-Column-through-JSL/td-p/41604
But had issues with type-mismatch.
There are other applications of this problem: Experiment.# and Experiment.Description
- Is there a better way to do this?
- Should the be done with Column Property Value Label or as part of Graph Builder?
- Ditto Value Ordering
- Should I submit a feature request?
Thanks!
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Using a second column as value labels OR How to plot one variable and have another appear as lab
Greetings Mark,
Here is what I did to get to the solution that I believe you need
- Create an new column which has a formula of: :Meeting.ID || "[" || Char( :Meeting.# ) || "]" This makes each entry as a unique entry
- Then for the new column, I set the Column Property "Row Order Levels". This means that the order of this column will be the order within the data table that the value is found.
Below are the results I got using your Meeting Attendance BarChart with the column that I generated
I have attached the data table I used
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Using a second column as value labels OR How to plot one variable and have another appear as lab
Mark, Jim's solution is a good one, and simpler to implement.
This is an FYI regarding your label script. Below is a script that will provide you with the labels you want. The value labels are assigned to :Meeting.#. Note, since :Meeting.# is numeric it does not require the "1" = "V1_0" but 1 = "V1_0".
Names Default To Here( 1 );
meetID = column("Meeting.#");
textID = column("X__10");
NamesValuesList = {};
For( i = 1, i <= nitems(meetID << get values ), i++,
Insert Into(
NamesValuesList,
Parse(
Char( meetID[i] ) || " = \!"" || textID[i] || "\!""
)
)
);
meetID << Set Property( "Value Labels", Eval( NamesValuesList ) );
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Using a second column as value labels OR How to plot one variable and have another appear as lab
Greetings Mark,
Here is what I did to get to the solution that I believe you need
- Create an new column which has a formula of: :Meeting.ID || "[" || Char( :Meeting.# ) || "]" This makes each entry as a unique entry
- Then for the new column, I set the Column Property "Row Order Levels". This means that the order of this column will be the order within the data table that the value is found.
Below are the results I got using your Meeting Attendance BarChart with the column that I generated
I have attached the data table I used
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Using a second column as value labels OR How to plot one variable and have another appear as lab
Mark, Jim's solution is a good one, and simpler to implement.
This is an FYI regarding your label script. Below is a script that will provide you with the labels you want. The value labels are assigned to :Meeting.#. Note, since :Meeting.# is numeric it does not require the "1" = "V1_0" but 1 = "V1_0".
Names Default To Here( 1 );
meetID = column("Meeting.#");
textID = column("X__10");
NamesValuesList = {};
For( i = 1, i <= nitems(meetID << get values ), i++,
Insert Into(
NamesValuesList,
Parse(
Char( meetID[i] ) || " = \!"" || textID[i] || "\!""
)
)
);
meetID << Set Property( "Value Labels", Eval( NamesValuesList ) );
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Using a second column as value labels OR How to plot one variable and have another appear as lab
Thanks! From your script I know see why mine did not work:
Parse( "\!"" || Char(ValuesList[i]) || "\!" = \!"" || LabelsList[i] || "\!"" ) )
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Using a second column as value labels OR How to plot one variable and have another appear as lab
Hello,
Is there an elegant way to add the value of each bar in the graph, prefereably vertically on the bar?
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Using a second column as value labels OR How to plot one variable and have another appear as lab
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Using a second column as value labels OR How to plot one variable and have another appear as lab
Thanks! Guess I can't use "Bullet" and Value labels together.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Using a second column as value labels OR How to plot one variable and have another appear as lab
Jim:
Thanks for the elegant solution!