Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

write a function Percentages _ CSA using a LAMBDA that inputs a column of names ( e . g . , season names ) and

write a function Percentages_CSA using a LAMBDA
that inputs a column of names (e.g., season names) and produces a row of percentages for the
alphabetically sorted unique names. The percentages specify the fraction of total rows containing
a unique name (e.g., Winter). Test your function with the Season data in the Festivals worksheet.
Notice that the length of the row of percentages depends on the data and needs to be computed
dynamically. Use two implementations to write your function Percentages_CSA, the first using
FILTER and the second using the function Percentages_from_0_1_table_CSA given below. We
give you almost a complete FILTER solution because FILTER will be covered in detail in the next
topic. Call the function with the FILTER implementation Percentages_FILTER_CSA. Call the
function with the 0_1_table as an intermediate result Percentages_0_1_table_CSA.
=LAMBDA(Names,LET(
SortedUnique,SORT(UNIQUE(UNKNOWN_1)),
CountOne,LAMBDA(s,ROWS(FILTER(Names,Names=s))),
CountsFILTER,MAP(SortedUnique, UNKNOWN_2),
Percentages,CountsFILTER/SUM(UNKNOWN_3),
Show,IFERROR(HSTACK(SortedUnique,CountsFILTER,Percentages),""),
Result,TRANSPOSE(CHOOSECOLS(Show,1,3)),
Result))({"Winter";"Summer";"Winter";"Spring";"Fall";"Winter";"Summer"})
You complete this LAMBDA by changing UNKNOWN_1, UNKNOWN_2, UNKNOWN_3 to the
correct names. For example, UNKNOWN_1 needs to be the formal argument Names.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Heikki Topi, Jeffrey A Hoffer, Ramesh Venkataraman

13th Edition

0134773659, 978-0134773650

More Books

Students also viewed these Databases questions