% Change to Prior Column - looker

So I have a series of data that the EU would like visualized as a bar chart displaying the % variance to the prior month. They only want the last 4 months. Easy enough. My problem is being a perfectionist I'd like the 4 months displayed BUT you technically need 5 months of data pulled to get 4 months of data and the 5th month has no value displayed because there's nothing to compare it to. Filters of course drop the 5th month's value. I just want it to not show that fifth month.

There are several ways to solve your problem:
Use the Limit Displayed Rows option in the Visualization Settings:
Choose to Hide the First 1 rows with the data of the 5th month being the first row to hide it. Source: Looker docs
Create a custom calculation to exclude that specific row. The calculation should be something like diff_months(${data.created_month},now())!=5. The value should be Yes except for the month you want to exclude. Then click on the Settings wheel next to your calculation's name and select Hide "No"'s from Visualization and Hide from Visualization.
Romain

Related

Vertical sum of column

I'm creating a report using RDLC, I need to sum up all the months column.
i.e. the row showing total should come after Dec-21, Sep-21...
On the month group, you just need to add a group total, like this
enter image description here

Is it possible to sort/group images create dates in a csv based on whether the following picture time is within 2 minutes of the previous?

The image has the before spreadsheet with the dark background and the white spreadsheet is what I need as an end product to group the images into subjectsI’m working with camera trap images that I want to have sorted into events, or the times when one individual is being detected in front of the camera. My csv currently has columns with the image ID, the size of the image, and the createdate or time stamp. I want to have any picture occurring within two minutes of the previous to be grouped together as an assumption of that being the same individual animal so it will only be identified once. In the csv each image ID would need to be present in a single cell going horizontal across the spreadsheet with each row representing an event.
I thought there may be a way to do this using the package lubridate, but I have not found anything that has pushed me in the right direction.
Any ideas?
It could be easy to add a new column in with the Group number.
Sort the images by date and put first one Group = 1
then
if ( date [row]-date[row-1] > 2 min ) group[row]= groupe[row-1]+1
Later you can convert that values to numbers and use them to rename the images or whatever you want.

How to add denominator count (Total sales) for stacked graphs in Tableau

I have built a bar graph using tableau for the following data. How to add Total sales (120,150,200,180,140) on top of the each bar in tableau
[The following image has the data and bar graph that I was trying to build]
[1]: https://i.stack.imgur.com/NdA7s.png
Thanks for your help
Hope this helps.
I pivoted the data first to make it easier by working with a single measure.
Go to the data tab and select the Sale A and Sale B measures:
Then hit the dropdown and select Pivot.
Then your data will look like this
Next, you want to set the fields up like this so it mirrors your screenshot.
The SUM(Pivot Field Values) is a table calculation set up as percent of total calculated Table (down).
Then just duplicate your measure by holding Ctrl and dragging to Rows. Make it a label in the Marks section. This will add the total. You just have to play with the axis and format to get it into the place you want from here.

Plotting multiple lines in Tableau

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):
In Excel, it takes me less than seconds to obtain a chart that looks like this:
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.
drag & drop measure values & timestamp.
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
remove no. of row & timestamp from the measure values.
uncheck aggregate measure.
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
select line from mark and drag measurement to color
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

Flex LineChart advanced horiztonal axis?

I want to make a line chart that allows the user to select a date range for the data. For example if the date range span is more than 1 month, I want to to have a bar that shows the months, also if the date range is around 30 days or less I want it to show the dates for each day as well. Something like that.
Does anyone have any suggestions?
Thanks!
I would suggest using a DateTimeAxis, and setting the labelUnits property to "days" or "months" as appropriate. The axis will then do all the hard work of grouping your data accordingly.
In your particular case, when the user makes a choice from the combo box, you should have a handler that computes how granular to make the x-axis based on the user's date selections.

Resources