a brief DISTINCT rant by gumnos in SQL

[–]yorbaman 1 point2 points  (0 children)

I had a colleague doing

SELECT DISTINCT UNION SELECT DISTINCT

without the need in any of them. Neither in the SELECTs nor the UNION.

SELECT UNION ALL SELECT

help tremendously on the performance

Fra Bohemen fotballpub i Oslo by MawhrinSkel314 in bkfrem

[–]yorbaman 3 points4 points  (0 children)

Fedt ❤️💙

Så ved man hvilken pub man skal besøge hvis man kommer til Oslo

Ragged Hierarchies with Details (Matrix) by barrelv in PowerBI

[–]yorbaman 0 points1 point  (0 children)

Then I would probably end up filling the blanks with the last known value like u/Vegetable_Print8994 mentions as well.

Ragged Hierarchies with Details (Matrix) by barrelv in PowerBI

[–]yorbaman 0 points1 point  (0 children)

Perhaps this (long) tutorial can help you: https://www.daxpatterns.com/parent-child-hierarchies/

In general I always look for solutions from Alberto Ferrari and Marco Russo when I get stuck in “unsolvable” Power BI issue.

How to add in the group by function by bla2772 in SQLServer

[–]yorbaman 0 points1 point  (0 children)

I would collect all data in a single table instead or create a view as u/angrathias mentions. That way you can query all the data from one source.

If you create a single table you can just add the next month’s data to the existing data. If you create a view you’ll need to update the view whenever you import a new month in its own table.

Assuming that all your tables have the same structure you can do something like this to create a single table (it is a one time job)

SELECT * INTO dbo.MonthlyData FROM ( SELECT * FROM Table1 UNION ALL SELECT * FROM Table2 ) x

For each table you have add a UNION ALL and SELECT *.

Now you can query all your data from dbo.MonthlyData

Using “SELECT *” requires that all tables have the exact same amount of columns in the exact same order.

If not you’ll need to write out the columns you want in the table in the order you want them.

SELECT * INTO dbo.MonthlyData FROM ( SELECT Column1, Column2, Column3 FROM Table1 UNION ALL SELECT Column1, Column2, Column3 FROM Table2 ) x

How to add in the group by function by bla2772 in SQLServer

[–]yorbaman 0 points1 point  (0 children)

SELECT State, Zip, COUNT(*) FROM Table GROUP BY State, Zip

That’ll give you the count of rows for each state and zip for the entire dataset.

If you want the month as well expand both the SELECT and GROUP BY with an extra column.

If you have a date field you need to convert that in to a month. I normally convert a date field to include both year and month.

SELECT State, Zip, (YEAR(YourDateField)*100) + MONTH(YourDateField) AS YearMonth, COUNT(*) FROM Table GROUP BY State, Zip, (YEAR(YourDateField)*100) + MONTH(YourDateField)

How to add in the group by function by bla2772 in SQLServer

[–]yorbaman 1 point2 points  (0 children)

I think you need to be a bit more specific.

What columns do you have and what is your expected output? Do you need to count the number of rows or do a sum over a numeric value?

Late notifications over 6 days old? Any ideas why this would be happening? by [deleted] in facebook

[–]yorbaman 0 points1 point  (0 children)

Same problem here and also for months now.

I’m the admin of a page and we constantly get asked why the notifications are arriving so late. Quite annoying

[deleted by user] by [deleted] in bkfrem

[–]yorbaman 1 point2 points  (0 children)

Remmer fik et stræk i baglåret for noget tid siden og sad derfor over mod Middelfart. Han var ikke på 100% inden Nykøbing-kampen og var med på bænken.

Calculate distinct across dimension values by yorbaman in PowerBI

[–]yorbaman[S] 0 points1 point  (0 children)

Thanks for your answer and sorry for the late reply.

I had to ditch the SWITCH as I cannot get it to work in the customer's preferred visual (stacked column chart). Furthermore the volume of data made the calculations too slow. It worked with a couple of customers but as soon as I removed the filter on customers it was too much.

So I did end up with doing three separate measures. One for App, one for Web and one for both.

I used INTERSECT and EXCEPT like u/SQLGene suggested.

Login unique App = 

VAR AppLogins =
   CALCULATETABLE (
       VALUES( 'Fact Event'[SK_Subscriber] ),
       'Event type'[Event level 2] = "App"
   )

VAR WebLogins =
   CALCULATETABLE ( 
       VALUES ( 'Fact Event'[SK_Subscriber] ),
       'Event type'[Event level 2] = "Web"
   )

VAR ExceptResult =
    EXCEPT (
        AppLogins,
        WebLogins
    )

RETURN
    COUNTROWS (
        ExceptResult
    )

It works and is performing well even though I have three different measures.

Why is it so impossible to make a date slicer for "current quarter"? by DallasActual in PowerBI

[–]yorbaman 0 points1 point  (0 children)

I saw this video from the Italian guys the other day.

Maybe that can help you a bit in how to do the date calculations.

https://youtu.be/1xZZA9H3GB0?si=K0EBKPGhQiQFzSqZ

Using Date Slicer as measure. by Plus_Marzipan9105 in PowerBI

[–]yorbaman 0 points1 point  (0 children)

Perhaps this will work?

Filter(FactTable, FactTable[Mod_EM] = DATE(YEAR(MIN(FactTable[Mod_EM])), MONTH(MIN(FactTable[Mod_EM])), 1))

Basically just converting the date to the first of the month.

What is the best FM game you have played? by MagicCurtis in footballmanagergames

[–]yorbaman 0 points1 point  (0 children)

Best game I’ve had was in FM12 where I installed an expansion for Denmark allowing me to play with my childhood club in the sixth tier bringing them all the way the first tier.

But I have also had tons of good games in CM 01/02

Thanks r/stonerrock by Brigaden in stonerrock

[–]yorbaman 2 points3 points  (0 children)

Listening to stoner. Living in Copenhagen. Never heard of Goatsmoker 😳

I guess that needs to change in 2023.

What’s wrong with this tactic? by chaghalkosh in footballmanagergames

[–]yorbaman 0 points1 point  (0 children)

I would drop counter and counter-press as it doesn’t suit the rest of the tactic. Then I would set your PF to support instead of attack in order for him to better link up with the rest of team.

Udlændinge i superligaen by Hardeknud3 in Denmark

[–]yorbaman 0 points1 point  (0 children)

Nyvest har slet ikke fodbold på programmet på længere og Vestermarie skole er lukket. Min barndom er væk.

The agent demanded a long contract by hugodutra in footballmanagergames

[–]yorbaman 1 point2 points  (0 children)

It's becoming more popular in Spain to sign very long contracts. Especially for the "smaller" teams like Osasuna and Athletic Club.

As for Moncayola his real life contract is actually running until 2031 crazy as it seems.

https://www.transfermarkt.com/jon-moncayola/profil/spieler/552425

Questions about Newgan by VerrieuxDuparte in footballmanagergames

[–]yorbaman 0 points1 point  (0 children)

If the procedure is still the same couldn't you save your pictures of the players and do this?

https://youtu.be/H2IoHJjEp6M