Hi Gurus!
I have a read-only table in google sheets. In my app, the user will specify their Sex (Male or Female) and Classification (Class A or Class B) in their profile. These values can be pulled into a Virtual Column Summary Table easily enough.
Iโd like to create a read-only Virtual Column Summary Table that tells the user their TARGET and CLASSES (for each ACTIVITY (1-to-3) based on the two conditions they specified in their profile.
So Iโll have a Virtual Columns that displays:
ACTIVITY 1 Target
ACTIVITY 2 Target
ACTIVITY 3 Target
ACTIVITY 1 Classes
ACTIVITY 2 Classes
ACTIVITY 3 Classes
There are three conditions: SEX, CLASSIFICATION, and ACTIVITY. SEX and CLASSIFICATION are dependant upon the user choice. ACTIVITY is NOT a selection as itโs a known variable so thatโs something we can specify in the formulation.
In google sheets, finding:
ACTIVITY 1 Target value is a DGET function.
DGET(database, field, criteria)
DGET(A1:E12, TARGET, {โSEXโ, โCLASSIFICATIONโ, โACTIVITYโ; (GENDER CHOSEN), (CLASSIFICATION CHOSEN BY USER), ACTIVITY 1})
What would be the equivalent expression to find TARGET for each ACTIVITY based on their chioces of SEX and CLASSIFICATION?
Finding the โCLASSESโ value would be the similar expression I would imagine except change the field from TARGET to CLASSES.
Hope this makes senses.
Solved! Go to Solution.
@Tony_Insua
Assuming that the table in your post is your ACTIVITY table. You can create 3 virtual columns in USER PROFILE table, one for each activity and set the expression:
ANY(
SELECT(
Activity[TARGET],
AND(
[SEX] = [_THISROW].[SEX],
[CLASSIFICATION] = [_THISROW].[CLASSIFICATION],
"ACTIVITY 1" = [ACTIVITY]
)
)
)
ANY(
SELECT(
Activity[CLASSES],
AND(
[SEX] = [_THISROW].[SEX],
[CLASSIFICATION] = [_THISROW].[CLASSIFICATION],
"ACTIVITY 1" = [ACTIVITY]
)
)
)
@Tony_Insua
Assuming that the table in your post is your ACTIVITY table. You can create 3 virtual columns in USER PROFILE table, one for each activity and set the expression:
ANY(
SELECT(
Activity[TARGET],
AND(
[SEX] = [_THISROW].[SEX],
[CLASSIFICATION] = [_THISROW].[CLASSIFICATION],
"ACTIVITY 1" = [ACTIVITY]
)
)
)
ANY(
SELECT(
Activity[CLASSES],
AND(
[SEX] = [_THISROW].[SEX],
[CLASSIFICATION] = [_THISROW].[CLASSIFICATION],
"ACTIVITY 1" = [ACTIVITY]
)
)
)
@LeventK As always, your support is greatly appreciated. Iโm nearing the completion of my first app thanks to you and others in this community. Super excited.
Youโre welcome
User | Count |
---|---|
15 | |
12 | |
9 | |
8 | |
4 |