KQL solution fails the goal because sort by defaults to descending order

Ingest and transform streaming data
Answer Correct answer: B - The KQL sort operator defaults to descending order and the solution's 'sort by No_Bikes' omits asc, so the ascending requirement is not met.

Note: This question is part of a series of questions that present the same scenario. Each question in the series contains a unique solution that might meet the stated goals. Some question sets might have more than one correct solution, while others might not have a correct solution. After you answer a question in this section, you will NOT be able to return to it. As a result, these questions will not appear in the review screen. You have a Fabric eventstream that loads data into a table named Bike_Location in a KQL database. The table contains the following columns: BikepointID - Street - Neighbourhood - No_Bikes - No_Empty_Docks - Timestamp - You need to apply transformation and filter logic to prepare the data for consumption. The solution must return data for a neighbourhood named Sands End when No_Bikes is at least 15. The results must be ordered by No_Bikes in ascending order. Solution: You use the following code segment: Does this meet the goal? - image

  1. Yes
  2. No Correct Answer

Community Votes

B
100%

100% of anonymous learners picked answer B. Votes are pick records left by other test-takers — they are not the verified answer.

Community Insight

The KQL sort operator defaults to descending; meeting an ascending-order requirement requires an explicit asc modifier, and the proposed solution's 'sort by No_Bikes' omits it.

The proposed KQL code filters bike_location for Sands End with No_Bikes >= 15 and sorts by No_Bikes without the asc modifier; the KQL sort operator returns rows in descending order by default, so the required ascending order is not met.

Assuming KQL sort behaves like T-SQL's ascending ORDER BY; KQL defaults to descending, so the solution returns the highest No_Bikes values first.

Community Discussion (5 comments)

SamuComqi 👍 9 Selected: B
The answer is B. No because the "sort by" is sorting values in descending order (default behavior --> https://learn.microsoft.com/en-us/kusto/query/sort-operator?view=microsoft-fabric). One should add "asc" to sort values as required. The double "project" at the end does not affect the final result
benni_ale 👍 1 Selected: B
sort by in kql is by default in descending order
MuffiSan 👍 4 Selected: B
sort is desc by default in kql
GHill1982 👍 3 Selected: B
In KQL the where keyword should be used instead of filter.
QAZdbarhate12345678 👍 1
The provided code segment meets the goal. Breakdown: Filter Condition: The code uses filter Neighbourhood == "Sands End" and No_Bikes >= 15 to meet the requirement of filtering the data for the "Sands End" neighborhood and where No_Bikes is at least 15. Sorting: The sort by No_Bikes clause ensures that the results are ordered by No_Bikes in ascending order, which aligns with the requirement. Projection: The fields BikepointID, Street, Neighbourhood, No_Bikes, No_Empty_Docks, and Timestamp are projected, which ensures the required fields are returned for the query. Hence, the solution is correct and achieves the stated goal. The correct answer is A. Yes.

Comments & Corrections

No comments yet — spotted an error or have a note? Share it below.

Log in to comment, report an error, or add a note about this question.

Submitted for moderation before publishing. Keep it helpful and respectful.

Expert Analysis

Why the Answer Is Correct

The requirement states results must be ordered by No_Bikes in ascending order. The KQL sort operator returns rows in descending order by default, and ascending order requires explicitly specifying asc. The proposed code segment - filter Neighbourhood == "Sands End" and No_Bikes >= 15, then 'sort by No_Bikes' with no asc - returns rows from highest to lowest No_Bikes and does not meet the goal. Hence the answer is No.

Why the Other Options Are Wrong

Option A (Yes) would only hold if the solution explicitly sorted ascending, which the documented default behavior rules out. The filter logic itself (Sands End, No_Bikes >= 15) is satisfied, and the doubled project lines do not change the result, so ordering is the deciding failure.

Community Comment Notes

The community is unanimous (B 100). SamuComqi (9 likes) explains the sort operator's default descending behavior, links the sort operator documentation, and notes the double project does not affect the result. MuffiSan and benni_ale repeat the default-desc rule, and GHill1982 additionally notes where should be used instead of filter.

Official Reference

Related Analysis

← Back to DP-700 Study Guide