Skip to main content
Announcements
Marching toward a simplified navigation! READ ON
cancel
Showing results for 
Search instead for 
Did you mean: 
wynnjimbbt
Contributor III
Contributor III

GetFieldSelections returns Null() on multiple selections

the expression and variables below work except when making multiple selections on fields [Ref Qualified Week Ending] or field [Week Ending]. Returns null() when making multiple selections on fields [Ref Qualified Week Ending] or [Week Ending]

vGetQualfWeekEnding =

if(GetSelectedCount([Ref Qualified Week Ending])>0,Date(GetFieldSelections([Ref Qualified Week Ending]),'MM/DD/YYYY'), if(GetSelectedCount([Week Ending])>0, Date(GetFieldSelections([Week Ending]),'MM/DD/YYYY'),'*'))

1 Solution

Accepted Solutions
pradosh_thakur
Master II
Master II

or this

vGetQualfWeekEnding =

if(GetSelectedCount([Ref Qualified Week Ending])>0,

CONCAT(distinct Date([Ref Qualified Week Ending],'MM/DD/YYYY'),','),

if(GetSelectedCount([Week Ending])>0, CONCAT(distinct Date([Week Ending]),'MM/DD/YYYY'),','),          '*'       )

)

Learning never stops.

View solution in original post

11 Replies
luismadriz
Specialist
Specialist

Hi Jim,

That's expected behaviour. If the count > 0 then multiple dates are used, you may need an aggregation such as Max, Min, etc. to be used on Ref Qualified Week Ending and Week Ending

Cheers,

Luis

sergio0592
Specialist III
Specialist III

So, you can apply date formating in your load statement for your two fields in order to avoid to use Date() in your expression.

wynnjimbbt
Contributor III
Contributor III
Author

so I use this same logic on three other fields and return multiple values

vGetQualfYear =

if(GetSelectedCount([Ref Qualified Year])>0,GetFieldSelections([Ref Qualified Year]),if(GetSelectedCount([Year])>0, GetFieldSelections([Year]),'*'))

vGetQualfMonth =

if(GetSelectedCount([Ref Qualified Month])>0,GetFieldSelections([Ref Qualified Month]),if(GetSelectedCount([Month])>0, GetFieldSelections([Month]),'*'))date

I do not want the max or min  [Ref Qualified Week Ending] dates if we select three dates I need them all

luismadriz
Specialist
Specialist

Ok, then you may need to format the dates on the load instead.

luismadriz
Specialist
Specialist

Remember that getfieldselections returns a string and you may need to configure that string,. What would happen is ALL dates are selected, of ALL but one or two. How many dates do you want listed, etc.

Untitled.png

MayilVahanan

Hi

In that case, you can try like below

GetFieldSelections([Ref Qualified Week Ending], ',', 1000)


Third Parameter is nothing but you can mention Max values, for example, I mentioned 1000. And also, recommend to use date format in back end itself.

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
pradosh_thakur
Master II
Master II

What about this

vGetQualfWeekEnding =

if(GetSelectedCount([Ref Qualified Week Ending])>0,

CONCAT(Date([Ref Qualified Week Ending],'MM/DD/YYYY'),','),

if(GetSelectedCount([Week Ending])>0, CONCAT(Date([Week Ending]),'MM/DD/YYYY'),','),          '*'       )

)

Learning never stops.
pradosh_thakur
Master II
Master II

or this

vGetQualfWeekEnding =

if(GetSelectedCount([Ref Qualified Week Ending])>0,

CONCAT(distinct Date([Ref Qualified Week Ending],'MM/DD/YYYY'),','),

if(GetSelectedCount([Week Ending])>0, CONCAT(distinct Date([Week Ending]),'MM/DD/YYYY'),','),          '*'       )

)

Learning never stops.
wynnjimbbt
Contributor III
Contributor III
Author

Thanks!

This was very helpful.

=if(GetSelectedCount([Ref Qualified Week Ending])>0,
CONCAT(Distinct Date([Ref Qualified Week Ending],'MM/DD/YYYY'),','),
if(GetSelectedCount([Week Ending])>0, CONCAT(Distinct Date([Week Ending],'MM/DD/YYYY'),','),'*'))