Conditional Formatting with icon sets and relative referencing in excel
Tag : excel , By : arbeitandy
Date : March 29 2020, 07:55 AM
it should still fix some issue Without % appearing in all cells the only way I can see to meet your requirement is to enter 100 in those cells to display tick and 100% and then format those specific cells #,###"%".
|
Referencing different sets of elements using d3 js
Date : March 29 2020, 07:55 AM
To fix this issue selection.filter can be used to filter down a selection based on data. You can use the datum from the event target to filter down a selection like this:var circleMatch = svg.selectAll(".highcircles")
.filter(function(d) {
return d.key === targetDatum.key; // 'key' is some datum-unique property
});
|
How to find sets of rows with one or more fields matching and assign a set id for each matching set?
Tag : sql , By : picamiolo
Date : March 29 2020, 07:55 AM
With these it helps I believe this will give you your desired result. A little explanation is in the comments, let me know if more is needed. with relations
--Get all single relationships between vendors.
as (
select t1.vendorId firstId,
t2.vendorId secondId
from VendorMaster t1
inner join VendorMaster t2 on t1.vendorId < t2.vendorId and(
t1.Phone = t2.Phone
or t1.address = t2.address
or t1.Fax = t2.Fax
)
),
recurseLinks
--Recurse the relationships
as (
select r.*, CAST(',' + CAST(r.firstId AS VARCHAR) + ',' AS VARCHAR) tree
from relations r
union all
select r.firstId,
l.secondId,
cast(r.Tree + CAST(l.secondId AS varchar) + ',' as varchar)
from relations l
inner join recurseLinks r on r.secondId = l.firstId and r.tree not like '%' + cast(l.secondId as varchar) + ',%'
union all
select r.firstId,
l.firstId,
cast(r.Tree + CAST(l.firstId AS varchar) + ',' as varchar)
from relations l
inner join recurseLinks r on r.secondId = l.secondId and r.tree not like '%' + cast(l.firstId as varchar) + ',%'
),
removeInvalid
--Removed invalid relationships.
as (
select l1.firstId, l1.secondId
from recurseLinks l1
where l1.firstId < l1.secondId
),
removeIntermediate
--Removed intermediate relationships.
as (
select distinct l1.*
from removeInvalid l1
left join removeInvalid l2 on l2.secondId = l1.firstId
where l2.firstId is null
)
select result.secondId,
dense_rank() over(order by result.firstId) SetId
from (
select firstId,
secondId
from removeIntermediate
union all
select distinct firstId,
firstId
from removeIntermediate
) result;
|
SQL Server hierarchy referencing and cross data referencing
Date : March 29 2020, 07:55 AM
like below fixes the issue This might be a stupid question, but I am not a DBA and kind of stuck with this issue. I have an application that trickles down all effects (asdf) under an applied ID (IDParent). , I think a loop could help you. Try this: CREATE TABLE #t1 (IDChild Int, IDParent Int);
CREATE TABLE #t2 (RandoID NVARCHAR(10) , IDChild Int);
CREATE TABLE #RandoName (RandoID NVARCHAR(10), RandoName VARCHAR(50));
INSERT INTO #t1 VALUES (321, NULL), (123,321),(124,123),(116,124)
INSERT INTO #t2 VALUES ('asdf', 123)
INSERT INTO #RandoName VALUES ('asdf', 'something')
SELECT ROW_NUMBER() OVER (ORDER BY (SELECT 100)) [RowNum], a.IDChild a, a.IDParent b, b.IDChild c INTO #t3 FROM #t1 a
LEFT OUTER JOIN #t1 b ON b.IDParent = a.IDChild
DECLARE @rownum INT;
DECLARE cbcursor CURSOR for Select RowNum FROM #t3;
OPEN cbcursor;
Fetch Next from cbcursor into @rownum
WHILE @@FETCH_STATUS = 0
BEGIN
UPDATE #t3
SET c = (SELECT b from #t3 where RowNum = @rownum-1)
WHERE RowNum = @rownum
Fetch Next from cbcursor into @rownum;
END;
Close cbcursor;
Deallocate cbcursor;
SELECT a,b,t2.RandoID, r.RandoName FROM #t3
LEFT OUTER JOIN #t2 t2 on t2.IDChild = #t3.c OR t2.IDChild = #t3.b OR t2.IDChild = #t3.a
LEFT OUTER JOIN #RandoName r on t2.RandoID = r.RandoID
|
Referencing one field for two different sets of related IDs in MySQL
Date : March 29 2020, 07:55 AM
this one helps. You need to add a join on the table again to get the description of the prerequisite course, hope that will help. SELECT CONCAT(c.course_id,': ',c.title) AS Course,
CONCAT(p.prereq_id,': ',pc.title) AS Prerequisite
FROM uni_course AS c
INNER JOIN uni_prereq AS p ON c.course_id = p.course_id
INNER JOIN uni_course AS pc ON p.prereq_id = pc.course_id;
|