Table:
0
A
B
C
D
E
F
G
1
invoice id
order id
payment method code
product id
order quantity
other item details
order item id
2
128
14
MasterCard
4
2
1
3
162
13
MasterCard
9
2
9
4
164
7
Visa
7
2
1
5
212
8
Visa
4
2
8
6
272
10
American E
3
2
5
7
398
3
American E
4
1
5
8
406
14
MasterCard
7
2
1
9
483
7
Visa
8
1
3
10
548
4
MasterCard
3
1
1
11
587
1
American E
4
2
1
12
612
6
American E
3
1
8
13
633
11
Visa
2
1
7
14
679
12
MasterCard
9
2
8
15
733
11
Visa
6
1
4
16
777
7
MasterCard
6
2
7

Questions and formulas:
Question: What are the distinct payment method codes in all the invoices?
Formula: UNIQUE(C1)
Formula2: UNIQUE(C2:C16)
Level: easy
Question: Show me the distinct payment method codes from the invoice record.
Formula: UNIQUE(C1)
Formula2: UNIQUE(C2:C16)
Level: easy
Question: Show all payment method codes and the number of orders for each code.
Formula: SUMMARIZE(C1,SUMX(B1))
Formula2: SUMMARIZE(C2:C16,SUMX(B2:B16))
Level: easy
Question: List the distinct payment method codes with the number of orders made
Formula: SUMMARIZE(C1,SUMX(B1))
Formula2: SUMMARIZE(C2:C16,SUMX(B2:B16))
Level: easy
Question: What is the payment method code used by the most orders?
Formula: TAKE(SORT(SUMMARIZE(C1,SUMX(B1)), 2, -1), 1)
Formula2: TAKE(SORT(SUMMARIZE(C2:C16,SUMX(B2:B16)), 2, -1), 1)
Level: hard