Question: 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!