Group By Option in Grafana 5.2.4 - Graph Configuration

Hi Team,

I’m currently on Grafana 5.2.4 and pushing the data to Grafana using influxdb.I somehow find it hard to configure my line graph with the Group By option. My data looks something like below -

DATETIME,ENV,VERISON,CPU,MEM
2018-09-14 11:02:40.811Z,QA1,18438,2.3,1.1
2018-09-14 11:03:40.455Z,QA2,20122,3.3,5.3
2018-09-14 11:04:40.811Z,QA1,18438,5.5,2.2
2018-09-14 11:05:40.888Z,QA2,20122,18.2,5.9
2018-09-14 11:06:40.811Z,QA1,18438,6.9,1.6
2018-09-14 11:07:40.456Z,QA2,20122,3.8,7.7

I would like to have graph where i want my CPU and MEM shown in the same graph for both the environments. (example image for CPU below).

Untitled

Could you please suggest how is this achievable or should i make any change in the way my csv data is written. Please clarify