Sliderinput Shiny from own dataset - input

I'm currently working on a shiny app, but I've got some problems with a slider input. I've got 500.000 variables called 'duration' which all correspond a specific 'price'. However, the range of the duration is between 1-around 50000, so min - max isn't working properly. Therefore I want to address the duration based on my own data duration data set(skipping duration numbers which don't exist) and match the corresponding price with that duration. As there are many durations with different prices, a histogram seems to be most logical.
So my question, how do I customize these sliders with my own data?

Related

Stata Create panel dataset with two dataframes, no common variable

I am creating a city-by-day panel from scratch, but I'm having trouble balancing and filling in the data. Every city needs to have an observation every day between 01jan2000 and 31dec2019, my variable of interest is a dummy variable recording whether or not an event took place on that day in that city.
My original dataset only recorded observations if event == 1, and I managed to fill in time gaps using tsfill, but I can't figure out how to balance the data or extend it to start on 01jan2000 and 31dec2019. I need every date and city because eventually it will be merged with data that uses that sample period.
My current approach is to create a balanced & filled in panel and then merge the event data using the date it took place. I have a stata df containing the 7,305 dates, and another containing the 273 cityid's I'm observing. Is it possible to generate a new df that combines these two so all 273 cities are observed every day? essentially there will be 273 x 7,304 observations, no variables of interest.
Any help figuring out how to solve the unbalanced issue using either of these approaches is hugely appreciated.

TwinCat3 TE2000 HMI how to setup recipe managment with restrictive input?

I'm currently setting up a HMI as a Project at work. The operator will create a recipe that includes the following:
General recipe data (strings) e.g. customername, comment. - Input is not restricted
Number values (real) e.g. temperature, Moisture. - Input is restricted to min and max values
Timespans (timespan) e.g. heating time, cooling time - Input is restricted to time, min and max values
A recipe would look something like this:
memberName
Value
Unit
Comment
Customername
My Customer
-
The customer name of this recipe
Product
Flour
-
Used product for this recipe
Temperature container
45
°C
Setpoint temperature in container
Target Moisture
11
%
Target product moisture
Heating time
1h 30min
time
Total heating time
Drying time
30min
time
Total drying time
So far I have managed to load a saved recipe into a datagrid like I displayed above with the help of the infosys example:
https://infosys.beckhoff.com/english.php?content=../content/1033/te2000_tc3_hmi_engineering/53218196597888701067.html&id=
I modified the ConvertToDatagrid.js function so that it also returns the min, max, comment and unit of each memberName.
The issue with this solution is that I can't figure out how to restrict and check for valid inputs in the individual cells. You shouldn't be able to enter a number higher than than the max or lower than the min value. I'd also like to display a timespanpicker when selecting a cell which needs a time input.
I thought about just replicating a Datagrid with textboxes but I don't know how to select data from the array provided by ConvertToDatagrid.js. Another option would be to just link the symbols of the recipe to the textboxes but then I would have to always activate the recipe when selecting it which doesn't really seem that clean either.
I'd be glad if someone experienced with the recipe management could help me :)

SSRS Bar Chart Filtering Incorrectly

I am trying to create a chart showing the 10 highest-performing teams according to their "proportion of target achieved" score.
My dataset comprises every day worked by every individual in my organisation. The data is grouped in a stored procedure by month, team, job role, area of the organisation...
My SSRS report takes this data and sums it at a report level, based on a half-dozen parameters (mainly to the above groups).
The data is presented via a table, showing (for a given person/group/category) the hours worked, actual contact time (time with clients), expected contact time (time they're meant to spend with clients), and the proportion of their target they are achieving (actual contact time / expected contact time). All of this is reported for each of the last 6 months.
I.e.
I wanted to create a bar chart showing the 10 teams with the highest proportion of target achieved values. This variable is calculated in SSRS in order to allow for the data to be more flexible.
SSRS wouldn't let me use that calculation in a chart filter, so I added a denserank (called TeamOrder) for the teams in the stored procedure.
This is where the issue arises.
TeamOrder is used in the filter, and set to <= 10. 10 teams are displayed in the graph, but not the 10 that have values of TeamOrder equal to 1-10. The top couple are right, but in 10th position, for example, it's displaying the 32nd-best team.
Weirdly, when I set the filter to TeamOrder = [value], then it displays the one (correct) team (including the correct number 10 when TeamOrder = 10).
I'm at a complete loss as to what might be happening; any help would be enormously appreciated.

Two Dimensional Diagram with aggr function

I'm having a very curious Problem in QlikView.
I have a number of readouts from a Database which show certain amounts of time in a different state.
In that table there are 49 variables that describe the state, there are 7 levels of i.e the SOC and seven states of the Temperature.
i.e the one of the fields could be named: SOC1_T1 or SOC2_T1 and so on...
So what i get is a table full of readouts in which every i have an specific id for the object, the state of the variables and an age. There are multiple entries per Object.
What i want to do is to plot a two dimensional diagram over all the states so i get SOC over Temperatur Histogram(Average of the maximum (or newest) value of every object).
I tried creating to Dynamic (or syntethic) Dimensions (ValueLoop(1,7) and ValueLoop(1,8).
In the formulas i reffered to them with
=If(ValueLoop(1,7) = 1 and ValueLoop(1,8) = 1,
(avg(aggr(FirstSortedValue (SOC1_T1
, -age), id)) * 100))
and created 49 Formulas with each state variable output.
Problem now is:
It only shows the first entry. I can replace the whole expression in the if condition with a specific number (100) and get a result. I also plotted the inner expression into a Listbox and checked wheter the result is not null.
As soon as I delete the aggr function and just take the AVG over everything (which is not what i want). Everything works fine. When i turn back to aggr, only the first one is shown.
Doesnt help by the way when i delete one of the dimensions, this doesnt work one dimensional either.
Any ideas or workarounds?
Greetings
Julian

Can you graph a time-series with continuously changing entries?

How do I graphically represent a time-series where entries of this graph change over time?
For example I have a database of cities and their corresponding average temperature per day. I want a graphical representation of the ten hottest cities per day, and how they change over time. Do new cities appear on this list? Which cities drop out of this list?
Normally 6/10 of these cities will always be on the “top ten hottest” list, but sometimes a particular entry may spike up and join the top ten list. Is there a way to analyze the top ten list and compare it over time?
I’m having trouble thinking of a way to graph this because of the varying entries.
Your x-axis is day, but what's on the y-axis? Temperature? If so, you can have a different series (may be called something else depending on your charting package) for each city, and just add points to the series when it is one of the top ten for that day. This may require you to do some pre-processing on your data, in order to figure out which set of cities makes the top-ten list over your time frame.
In one of our widget implementations we have a setting for the time chart to display only top-n series, ranked by avg or last value. This was done to remove clutter by hiding too many unimportant series from the chart.
In your case why not show a bar for each period where the bar would contain top-N series for the period and a grey area for the remainder?