## Value of using multiple social media platforms

I am the social media person for an amateur sporting organisation.

It is voluntary work and quite a time consuming doing a good job with (1) Facebook to get it right and I also duplicate some of these posts in my club notes section of a (2) local newspaper and we also have an extensive (3) Email Newsletter.

Although we have an extensive following, only a few people click on LIKE and/or SHARE, I assume that the same would happen for (4) Twitter and (5) Instagram.

Even though it’s a…

Value of using multiple social media platforms

## Cannot SUM the value of a field

I wonder if someone can help me with this SQL 2016 query.

I have two tables with following data

TblSalesRep This is the table holding the history of the territories that the sales rep looked after and the date range that they looked after it.

TerritoryId SalesRep FromDate ToDate 15 Anne 2020-01-01 2020-06-02 15 Dave 2020-06-03 2020-06-16 15 Anne 2020-06-17 2020-06-22 18 Anne 2020-06-23 2999-12-31

This is the table that holds the sales made by territory

tblSales TerritoryId TransactionId TransactionDate ProductCode Amount 15 1 2020-04-15 Bags 50 15 1 2020-04-15 Bags 50 15 2 2020-06-02 Bag 25 15 3 2020-06-03 Shoes 60 15 4 2020-06-07 Shoes 10 15 5 2020-06-17 Bags 15 15 6 2020-06-18 Bags 25 15 7 2020-06-25 Coat 100 18 8 2020-06-27 Bags 20

I’m trying to produce a report that displays the SalesRep and the total sold between two dates for a given SalesRep.

For example, if I provided a SalesRep = ‘Anne’ and a date range of ‘1 Jun 2020’ to ‘30 Jun 2020’ I would expect a result back of :

SalesRep Sum Anne 185

This is because it should exclude any business sold between 3 Jun 2020 – 16 Jun 2020 as the territory was looked after by Dave for a couple weeks and he sold that business between those dates.

I’ve tried using SUM function whilst joining to TblSalesRep but the figures are not what I’m expecting.

## Group by Multiple columns and then count different value of same column

I want to achieve the result which tells me the number of males and females of each disability types in each district. each district can have multiple disabilities.

So far i have reached the following query :

  SELECT    DistrictId,    fb.DisabilityTypeId,    SUM(     CASE WHEN GenderId = 1 THEN 1 ELSE 0 END   ) AS Male,    SUM(     CASE WHEN GenderId = 2 THEN 1 ELSE 0 END   ) AS Female  FROM    Districts d    LEFT OUTER JOIN FormAddresses a ON d.Id = a.DistrictId    INNER JOIN PeopleForms pf ON a.PeopleFormId = pf.Id    INNER JOIN FormBeneficiaries fb ON pf.Id = fb.PeopleFormId    INNER JOIN FormPersonalInfos fp ON pf.Id = fp.PeopleFormId  where    a.IsDeleted = 0    AND pf.FormTypeId = 2    AND d.CityId = 3  GROUP BY    DistrictId,    fp.GenderId,   fb.DisabilityTypeId 

which gives the following result :

DistrictId  |   DisabilityTypeId    |   Male  | Female     1       |       2               |   1     |     0     3       |       2               |   0     |     3     5       |       16              |   1     |     0     5       |       20              |   2     |     0     5       |       20              |   0     |     1     

But i want to achieve the following result :

DistrictId  |   DisabilityTypeId    |   Male  | Female     1       |       2               |   1     |     3     5       |       16              |   1     |     0     5       |       20              |   2     |     1 

i somehow managed to get the expected result, but that with some complex sub-queries in the select clause of each gender which i didnt like and was not sure about the performance.

how can i write an efficient query for the desired result that i want?

Thanks.

## Symbolic minimum value

I have the following polynomial expression v1[z]:

-((5 L^3 q z)/(12 J Y)) + (L^2 q z^2)/(4 J Y) - (L q z^3)/(12 J Y) 

and I would like to symbolically evaluate its minimum in 0<z<L, with q>0, L>0, J>0 and Y>0. How can I do this?

I have tried the following numerical way:

minv1 = Minimize[{v1[z] /. q -> 1 /. L -> 1 /. J -> 1 /. Y -> 1,z > 0, z < 1}, z ] 

## What is the comparative value of armor proficiencies?

The intent is that I want to playtest some racial features in a restricted setup, before using them in more complicated homebrew endeavors. Applying medium or heavy armor proficiency to this race seems like the easiest way to playtest medium / heavy armor proficiency as racial feature.

The way I see it, it seems that light and heavy armor have other restrictions than proficiencies, such as the reliance on Strength or Dexterity and, in the case of heavy armor, stealth disadvantage. On the other hand, there are no races that grant heavy armor proficiency and there are quite some (sub)classes that grant access to light and / or medium but not heavy armor.

Is medium or heavy armor proficiency as racial feature more powerful (in general) than light armor, or is it just favoring different kinds of builds?

I will use armor proficiencies on homebrew races in the future but first playtest it on the hobgoblin. I would therefore prefer a more general analysis, but considering the specific example (see below) would of course be appreciated.

Given the hobgoblin race with the following feature:

Martial Training. You are proficient with two martial weapons of your choice and with light armor.

would the race become more or less powerful when granting medium or heavy armor instead of light, or would it just lend itself to different builds?

I intend to use the change with the optional rules from TCoE concerning the customization of ASIs. Therefore, the specific ASIs of the race should not be relevant for the analysis.

## How to plot a set of complex numbers with given argument and absoulute value bounds

I want to plot the following complex numbers $$z \in \text{(complex numbers)}:\pi/4 < \arg (z) \leq 5 \pi/4,\ 1 \leq |z| < 2$$

I don’t know how to graph it so that it would look like 2D without any unecessary details. The closest I found how I want it to look is, when I looked at how graphing of parametric function looks. I tried to use contour plot to graph it, but I just can’t seem to do it…

ContourPlot[ Im[F[z[x, y]]], {3 pi/4 < arg (z) <= 5 pi/4, 1 <= abs (z) < 2}, {x, -.2, .2}, {y, -.2, .2}, PlotRange -> All, Contours -> Range[-5, 5, .5], ContourLabels -> True]

Does anybody know how to graph my set?

## Column in query should be selected according to value from another column

Assuming I have table1 with following data:

table1

id| coffee_sender | coffee_receiver | received_bag_size | sent_bag_size| price | 21  tux              -1                  m                 -1            45  22  alsa            -1                  -1                 xl            36 23  -1               tux                 l                 -1            51 

And I use the following query:

select t1.* from ( select t.price, t.id from table1 t  where coffee_sender in (tux, alsa)  or coffee_receiver in (tux, alsa) and received_bag_size in (m, xl) or sent_bag_size in (m, xl)) t1 

What i want is to only fetch the rows that have coffee_sender/coffee_receiver AND sent_bag_size/received_bag_size filled with a value (rows that match the following conditions):

coffee_sender = tux, sent_bag_size= xl 

OR

coffee_receiver = tux, received_bag_size= m 

OR

coffee_sender = tux, sent_bag_size = xl AND coffee_receiver = tux, received_bag_size= m 

So id = 21 would be excluded from the example table1.

How can i update the above query for this ? Thank you in advance.

## How to predict the next value in a table? [closed]

I have a table full of values. I want to know what the next values may be.

PostgreSQL cannot look into the future, but it can guess based on existing data.

I will not install any software or extensions.

I have not hooked this script up to a syringe full of poison which sticks me if it predicts the wrong number, nor will this mechanism be auto-trading on the stock market. I will not sue anyone if it predicts the wrong number. It will be used "for novelty purposes only".

What would be the most likely "algorithm" to stand the best chance of guessing the next value?

If I just do:

SELECT avg(integer_column) FROM table; 

I will get the average number. That seems like a reasonable guess, but it also seems a bit simplistic. It seems like it could do better than that, without getting into some kind of crazy, ultra-complex query.

## Hide ‘add to cart’ when certain value in dropdown is selected

Need help here please. I am trying to hide the ‘add to cart’ woocommerce button when a user selects a specific item in a dropdown list. I have tried multiple JQuery snippets in both functions.php and through 3rd party plugins but am still struggling to get it to work.

In Functions.php theme file

function load_scripts() { ?>     <script type="text/javascript">     $(document).ready(function(){$  (document.getElementsByName("select-1574795073993")).change(function(){             $( "select option:selected").each(function(){ if($  (this).attr("value")=="International"){                     \$  (".single_add_to_cart_button").hide();                 }             });         }).change();     });     </script> <?php } add_action('wp_enqueue_scripts', 'load_scripts'); 

Please can someone assist with simple steps to 1) provide correct code, and 2) insert in the woocommerce.com hosted plarform.

Much appreciated!

## How to increase price by 20% when value entered in SQL is VARCHAR

I am trying to increase the price of all items that are monitors by 20% but the current line is VARCHAR so when I try to increase by 20% I get the following error:

Msg 8114, Level 16, State 5, Line 1 Error converting data type varchar to numeric.

This was my data that I entered following steps on another post here

update Product set ProdPrice = ‘price * 1.2’ where ProdName like ‘%monitor%’

Here is what the full table looks like: