Hi,
I would like to accomplish the following task using JSL code:
I have an example file (attached) with 4 columns: date (numeric), y_val (numeric), limit (numeric), group (character).
The "group" column contains 3 distinct values: A,B,C
Each group has a unique value in "limit" column. For example, all group A rows have a value of 67 in the "limit" column.
The task:
1. I would like to create 3 charts (one for each group), each of them in different tab.
2. The tabs names should be according to groups. So A,B,C.
3. Each chart (Y by X) should have "date" in X axis, "y_val" in Y axis, and value of "limit" as a reference line on the y axis (that matches the specific group).
I have attached an example data table, as well as simple JSL script that gives the output I want.
However, the code has 3 drawbacks:
1. I specified the reference line values manually, instead of reading them from "limit" column.
2. I named the tabs "A","B","C" manually, instead of reading them from "group" column.
3. I manually created 3 tabs, instead of automatically counting how many tabs I need (according to the number of distinct values in "group" column).
I would like the solution to address the drawbacks above, as it should generalize for any number of groups (for example A-Z, which means 26 groups and 26 different values for reference lines).
Any help would be appreciated.
Thanks