11183
October 18, 2020, 6:28pm
1
Hi there
I want to count the number of select boxes, How can I Do?
If MATH was checked, then Socore show 1
If MATH and HISTORY was checked, then Socore show 2
If MATH and HISTORY and ART was checked, then Socore show 3
If MATH and HISTORY and ART and MUSIC was checked, then Socore show 5
In Scoreās column, I have triedā
switchif(thisRow.[MATH].Not() Or thisRow.[HISTORY].Not() Or thisRow.[ART].Not() Or thisRow.[MUSIC].Not(),1,thisRow.[MATH].Not() And thisRow.[HISTORY].Not() And thisRow.[ART].Not() And thisRow.[MUSIC].Not(),5)
IF(Count(True(thisRow.[MATH],thisRow.[HISTORY],thisRow.[ART],thisRow.[MUSIC]))<4,Count(True(thisRow.[MATH],thisRow.[HISTORY],thisRow.[ART],thisRow.[MUSIC])),5)
But all of it was unworkā¦
If anyone has any experience in this regard, would be very interested to know your experience.
Ander
October 18, 2020, 6:45pm
2
@11183
Hereās an approach you might be able to adapt to your use case:
@trader_umr
Clever technique to set sliders as booleans. @Johg_Ananda
Hereās another approach to throw in the mix:
CountIf(
List(thisRow.one,thisRow.two,thisRow.three,thisRow.four),
CurrentValue=true
)
Pch
October 18, 2020, 6:47pm
3
Thatās what I was going to suggest
List(thisRow.MATH,thisRow.HISTORY,thisRow.ART,thisRow.MUSIC).CountIf(CurrentValue=True())
Hi @11183 ,
You can add a column āCorrect Answers
ā with the following formula:
List(thisRow.MATH,thisRow.HISTORY,thisRow.ART,thisRow.MUSIC).CountIf(CurrentValue)
(which is the same @Pch just posted, btw. Note that you can shortcut CurrentValue=True()
, through CurrentValue
alone, as itās already a boolean)
And Score
column will have:
If(thisRow.[Correct Answers]=4,5 ,thisRow.[Correct Answers])
Pch
October 18, 2020, 7:00pm
5
Good catch @Federico_Stefanato .
I didnāt see the specific demand for 5 if everything was checked instead of 4
Federico_Stefanato:
(which is the same @Pch just posted, btw. Note that you can shortcut CurrentValue=True()
, through CurrentValue
alone, as itās already a boolean)
I really need to write a post-it with this very good point and keep it on my screen !
Thanks for pointing this out !
11183
October 19, 2020, 3:00pm
6
Its worked!!
Appreciate your helping!!
Thanks other userās answer too!! Thankyou very much!!
2 Likes