Plotting multiple lines in Tableau
Asked Answered
V

2

12

I read every possible forum and I couldn't find a specific answer. I'm new to Tableau and I need to perform what I thought would be a very simple task but I can't figure it out.

I need to create a chart with multiple lines plotted in the same graph. On one column, I have a timestamps in seconds (decimal). For each timestamp value, I have 4 columns associated (Temperature, Pressure, Humidity, Voltage) and I need to visualize how they trend over time. The data in Excel looks something like this (I simplified it for visualization purpose):

enter image description here

In Excel, it takes me less than seconds to obtain a chart that looks like this:

enter image description here

How can I replicate the same exact chart in Tableau? I would like someone to tell me exactly how each column should be formatted, if the data has to be a dimension or a measure and data type for each (string, number etc) and what steps to take in the chart. I would do this in Excel but the file is almost 1M rows and Excel keeps crashing.

Veterinary answered 22/6, 2017 at 17:50 Comment(1)
The feature you need to learn about in Tableau involves using the pseudo-fields Measure Names and Measure Values. Read about them in the online help.You can also look for the term "blended axis".Involucre
K
16
  1. drag & drop measure values & timestamp.

    enter image description here

    EDIT - first make Timestamp a dimension instead of a measure, and make sure it remains continuous instead of discrete. So you should not see the word SUM in front of Timestamp

  2. remove no. of row & timestamp from the measure values.

    enter image description here

  3. uncheck aggregate measure.

    enter image description here

EDIT this step is not usually needed or desirable. If you do have multiple recordings per Timestamp, you will want to select the best aggregation function for each measure, perhaps AVG or MEDIAN instead of SUM

  1. select line from mark and drag measurement to color

    enter image description here

Kure answered 23/6, 2017 at 8:56 Comment(4)
It worked really well, thank you! Finally a clear explanation step by step.Veterinary
@Mehul Katara: Can you please help me with real-time data in Tableau? :)Ratib
@SaurabhChauhan tableau doesn't support real-time on steaming data, You have to update dashboard by frequentlyKure
I read 10 different articles and none worked until this post, thank you so much! Tableau truly is the most unintuitive product I have worked with and this is not a hyperboleCharmine
A
1

If your X-axis is a Date Column, (i.e. You have a list of dates on your X-axis)

  • Drag your 'date column' to Columns and choose Month/Year/Week etc. and make it continuous
  • Drag 'Measure Names' to Filters and choose your Measures
  • Drag 'Measure Values' to Rows
  • Drag 'Measure Names' to the Colors section of the Marks card
Ardeb answered 11/4, 2021 at 20:19 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.