Clean Data of similar strings - data-cleaning

I am trying to figure out a way to clean this data. I essentially only want to keep the first 1-3 instances.For example, in this screenshot I would just want to keep the row with the description 'Soy Milk" wand delte the other ones
enter image description here
I am trying to figure out how to do this with SQL or pandas

Related

VBA to drill down specific data on Pivot Table

I am trying to get code so that by pressing a button, users can download certain source data from the Pivot Table. I have a PT set up that is controlled by slicers, so the PT size changes depending on what is selected (customer, date).
I have tried to record a macro, but when I double click the data I want to see, all the macro records is the cell reference, so this wont work if a different customer is selected.
I have attached some images which I hope helps demonstrate what I am trying to achieve.
Is there code that can do this? If so, can I get an example so that I can try to make it fit my working model?
Thank you
Raw data view
Pivot Table
Drill Down 1 e.g.
Drill down 2 e.g.

In Grafana, how do I display a table of system status using a normal DB table AND highlight based on text value?

I will start of by saying that I'm new to Grafana.
I have a database table that is being updated externally that has say 15 columns of information on a given set of servers. I'm just trying to display the server name and current status and change the color of the row based on that status (Norm, Alert, Down) ... ideally those would be links to a detail page.
I tried the included table display which looks like it should handle it but the coloring options don't seem to work based on plain dumb text in a column or it would be perfect because it says it will color by row and includes the ability to make each row a link essentially.
grafana screen shot
I have tried with and without quotes in the Threshold values. It says in the hover help you can use comma separated values but does not seem to work for me. (I am thinking it's my config or usage btw)
Every other plugin I can find that says it wants to do this errors out when I tell it I have a table of data and not some live feed.

How Do I generate Line Graph in PowerBI for the following Data

The Data I have looked like the Image below:
I want to create a line Graph,
The x-axis will have the Months (January to June), Y-Axis will have the Tot_QtY.
Considering that the date information is not in a single column but is spread out to multiple columns, How do I make a line chart.
Output I am getting is shown below:
The Output I need would look like this:
your input data is not correct, you need to model it so you get one column with rows of data. Click Edit Queries, this opens query editor.
Click tab Transform, select your columns and click unpivot.
My expectation is that you still need to work a bit more on your data because how the system knows from a column: MayDATE. that you talk about May. The best base data you can have is a column date and a colum value with data.

How to split data into rows

Hi I want to split one data columns by ";" and add it into rows. I believe in tableau this is called pivoting. But it wont work for me.
I have no issues splitting the data by delimiter, but it add's as column and not row. I don't get the option of pivoting afterwards, it could be due its a 'caulculated' field?
This one is not so easy, but let's get through this:
This is my sample data:
ID is still a number, I convert it to a dimension later.
Now, instead of creating a calculated field you do a custom split on your data, just like shown below. In the window that opens up you insert your seperator, which is ";" and the number of columns you need, which seems to be 10 in your case. I choose 3.
Then you create a table like this one:
and go on to create a crosstable like this:
then you klick on data and then paste. You'll now get a crosstable in a new sheet.
Now proceed by right-clicking on the newly created data source,
select the three Country-Split-columns, choose one to click on the arrow and click pivot. No you can delete the Country-Split-columns and you get this:
I think this might be what you want.

Tableau add formula to dashboard action filter?

I've got a workbook I'm building using public data https://public.tableau.com/profile/alee4645#!/vizhome/JSAClaimantsWardtimeseries/Dashboard1
The basics are working as I want, you see the map, you click on one of the coloured areas and a time series chart appears below the map showing the change over time for that area.
I want to add a couple of comparisons to this data, for example I want the time series chart to show a line for the whole coloured area (Somerset) so people can see how one part of it compares to the overall average.
I have the figures as separate rows in the data but of course when the action filter is triggered they get filtered out along with everything else.
If I edit the action filter in the filter shelf for sheet 2, it has the condition tab and I was hoping I could add [ward code] = "E10000027" (the comparison data I want to use) to the formula box so it would also keep the relevant rows of data, but that stops the chart working altogether.
I could achieve it by getting people to choose an area from a parameter drop down but I'd rather let them click on the map so they don't need to know the name of the area they are interested in.
Can this be done?