How to count [Total] where [Year] are in USER...

(Arnaud B.) #1

How to count [Total] where [Year] are in USERSETTINGS(Year_Option) ? THX

(Aleksi Alkio) #2

How about… COUNT(SELECT(TableName[Total],[Year]=USERSETTINGS(Year_Option)))

(Arnaud B.) #3

@Aleksi_Alkio That’s i try bur result is always the Count[Total] and not filter with YEAR

(Aleksi Alkio) #4

You can send it to aleksi@1track.com

(Arnaud B.) #5

@Aleksi_Alkio THX but it is OK. Praveen Seshadri have look into app and this is the solution:

It is because of a type mismatch.

USerSettings(Year_Option) is an EnumList of base type Text.

[Year] is a column of type Number.

You need to either convert the base type of the EnumList to Number. Or in the expression you can wrap [Annee] by a CONCATENATE()

IN(CONCATENATE([Year]), USERSETTINGS(Year_Option)) works the way you expect

(Aleksi Alkio) #6

I thought that I asked are they the same type;-)

(Arnaud B.) #7

@Aleksi_Alkio Yes of course. But for me it was OK, both are number. But one is EnumList and basetype was wrong set.

(Aleksi Alkio) #8

Are they both number fields?

(Arnaud B.) #9

Yes

(Aleksi Alkio) #10

Check them both with an simple expression for example in virtual column so you could see which one is not correct. USERSETTINGS(Year_Option) should give you 2018 or something.

(Arnaud B.) #11

@Aleksi_Alkio USERSETTINGS(Year_Option) return 2017,2018 it’s OK.

SELECT(Liste[YEAR], True, True) return the same thing 2017,2018 COUNT(Liste[TOTAL]) return number with Total of 8

I try this but return me 0 (zero): COUNT(SELECT(Liste[TOTAL],Liste[YEAR]=USERSETTINGS(Year_Option)))

(Aleksi Alkio) #12

Then try COUNT(SELECT(Liste[TOTAL],IN([YEAR],USERSETTINGS(Year_Option))))

(Arnaud B.) #13

Return 0,0,0,0,0,0,0,0 instead of 8

(Aleksi Alkio) #14

What is the account ID and app name so I can check quickly, thanks.

(Arnaud B.) #15

@Aleksi_Alkio

mail ?

(Aleksi Alkio) #16

How about… COUNT(SELECT(TableName[Total],[Year]=USERSETTINGS(Year_Option)))

(Arnaud B.) #17

@Aleksi_Alkio That’s i try bur result is always the Count[Total] and not filter with YEAR

(Aleksi Alkio) #18

You can send it to aleksi@1track.com

(Arnaud B.) #19

@Aleksi_Alkio THX but it is OK. Praveen Seshadri have look into app and this is the solution:

It is because of a type mismatch.

USerSettings(Year_Option) is an EnumList of base type Text.

[Year] is a column of type Number.

You need to either convert the base type of the EnumList to Number. Or in the expression you can wrap [Annee] by a CONCATENATE()

IN(CONCATENATE([Year]), USERSETTINGS(Year_Option)) works the way you expect

(Aleksi Alkio) #20

I thought that I asked are they the same type;-)