Forum Discussion
Sid25
6 years agoHelper II
how to create two line chart trend on same plot from single column
how to create two line trend from a single column, I wanna create the line chart one for normal and another one for abnormal, I don't wanna create the two-column for this purpose.i have tried grouping of data but it didn't work the way I wanted.when i created using it grouping it is displaying wrong data.
the data simply looks like as following:
| PatientID | place | PatientAge | MaleChild | FemaleChild | LMPDate | Result | Result | status | Proc_Date | care | RegDate | ReferredBy | PregWeeks |
| 101 | utah | 28 | 1 | 0 | 19-05-2017 00:00 | single | pos | normal | 14-02-2018 00:00 | yes | 14-02-2018 00:00 | Doctor | 37 |
| 102 | virginia | 30 | 1 | 0 | 20-05-2017 00:00 | single | sas | abnormal | 15-02-2018 00:00 | no | 15-02-2018 00:00 | Self | 19 |
| 103 | vermont | 24 | 0 | 0 | 21-05-2017 00:00 | divroced | neet | normal | 16-02-2018 00:00 | no | 16-02-2018 00:00 | Doctor | 16 |
| 104 | washington | 35 | 1 | 0 | 22-05-2017 00:00 | married | neet | abnormal | 17-02-2018 00:00 | yes | 17-02-2018 00:00 | Doctor | 14 |
| 105 | west virginia | 36 | 1 | 0 | 23-05-2017 00:00 | married | neet | normal | 18-02-2018 00:00 | no | 18-02-2018 00:00 | Doctor | 15 |
| 106 | oregon | 23 | 0 | 1 | 24-05-2017 00:00 | single paraent | sas | abnormal | 19-02-2018 00:00 | yes | 19-02-2018 00:00 | Doctor | 28 |
| 107 | ohio | 30 | 1 | 0 | 25-05-2017 00:00 | married | sas | normal | 20-02-2018 00:00 | No | 20-02-2018 00:00 | Doctor | 14 |
| 108 | north dakota | 20 | 0 | 1 | 26-05-2017 00:00 | divroced | neet | normal | 21-02-2018 00:00 | yes | 21-02-2018 00:00 | Doctor | 22 |
| 109 | oklahoma | 22 | 0 | 1 | 27-05-2017 00:00 | in a relationship | neet | normal | 22-02-2018 00:00 | No | 22-02-2018 00:00 | Doctor | 30 |
| 110 | new jersy | 23 | 0 | 0 | 28-05-2017 00:00 | in a relationship | neet | normal | 23-02-2018 00:00 | yes | 23-02-2018 00:00 | Doctor | 10 |
| 111 | new mexico | 28 | 0 | 1 | 29-05-2017 00:00 | in a relationship | neet | normal | 24-02-2018 00:00 | yes | 24-02-2018 00:00 | Doctor | 33 |
| 112 | north carolina | 22 | 0 | 0 | 30-05-2017 00:00 | single paraent | pos | abnormal | 25-02-2018 00:00 | No | 25-02-2018 00:00 | Doctor | 29 |
| 113 | montana | 26 | 0 | 0 | 31-05-2017 00:00 | divroced | pos | normal | 26-02-2018 00:00 | yes | 26-02-2018 00:00 | Doctor | 7 |
| 113 | navada | 23 | 0 | 1 | 01-06-2017 00:00 | in a relationship | pos | abnormal | 27-02-2018 00:00 | No | 27-02-2018 00:00 | Doctor | 24 |
| 114 | mississipi | 22 | 0 | 0 | 02-06-2017 00:00 | divroced | neet | abnormal | 28-02-2018 00:00 | yes | 28-02-2018 00:00 | Doctor | 16 |
| 115 | kentucky | 25 | 0 | 1 | 03-06-2017 00:00 | divroced | sas | abnormal | 01-03-2018 00:00 | No | 01-03-2018 00:00 | Self | 24 |
| 116 | maine | 23 | 0 | 0 | 04-06-2017 00:00 | in a relationship | sas | normal | 02-03-2018 00:00 | yes | 02-03-2018 00:00 | Doctor | 18 |
| 117 | indiana | 22 | 0 | 0 | 05-06-2017 00:00 | single paraent | sas | abnormal | 03-03-2018 00:00 | No | 03-03-2018 00:00 | Self | 33 |
| 118 | hawaii | 25 | 0 | 0 | 06-06-2017 00:00 | single paraent | neet | normal | 04-03-2018 00:00 | yes | 04-03-2018 00:00 | Doctor | 33 |
| 119 | illinois | 22 | 0 | 0 | 07-06-2017 00:00 | single paraent | neet | abnormal | 05-03-2018 00:00 | yes | 05-03-2018 00:00 | Self | 27 |
| 120 | florida | 28 | 1 | 2 | 08-06-2017 00:00 | single paraent | neet | abnormal | 06-03-2018 00:00 | No | 06-03-2018 00:00 | Doctor | 25 |
| 121 | oregon | 23 | 0 | 1 | 24-05-2017 00:00 | single paraent | sas | abnormal | 19-02-2018 00:00 | yes | 19-02-2018 00:00 | Doctor | 28 |
| 122 | ohio | 30 | 1 | 0 | 25-05-2017 00:00 | married | sas | normal | 20-02-2018 00:00 | No | 20-02-2018 00:00 | Doctor | 14 |
| 123 | north dakota | 20 | 0 | 1 | 26-05-2017 00:00 | divroced | neet | normal | 21-02-2018 00:00 | yes | 21-02-2018 00:00 | Doctor | 22 |
| 124 | oklahoma | 22 | 0 | 1 | 27-05-2017 00:00 | in a relationship | neet | normal | 22-02-2018 00:00 | No | 22-02-2018 00:00 | Doctor | 30 |
| 125 | new jersy | 23 | 0 | 0 | 28-05-2017 00:00 | in a relationship | neet | normal | 23-02-2018 00:00 | yes | 23-02-2018 00:00 | Doctor | 10 |
and graphs look like this...
the ultimate goal is to create the two-line chart for the normal and abnormal count as per their places.
could anyone please guide me through to get it done the best efficient way since I have been stuck to this problem for a quite long time. any help would be great.
- You don't need any Groups for this, Groups are for when you want to combine values (like 'in a relationship' combined with 'married' to group both as 'not single').
For this, you already have the 'normal' and 'abnormal' grouping that you want, so you just need to put Status in the Values AND put Status in Legend. You'll need to drag it from the fields pane twice. Then you should get the result you're looking for.
2 Replies
- amitchandakSuper User
Sid25 , Not very clear. Can you put a status on legend and check?
- AllisonKennedyCommunity ChampionYou don't need any Groups for this, Groups are for when you want to combine values (like 'in a relationship' combined with 'married' to group both as 'not single').
For this, you already have the 'normal' and 'abnormal' grouping that you want, so you just need to put Status in the Values AND put Status in Legend. You'll need to drag it from the fields pane twice. Then you should get the result you're looking for.