Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
When utilizing the expression:
({1< pt_Segment = {"$(=$(vSegment))"}>} Count(distinct pt_IPNO&pt_YHNO))
the variable vSegment
, which is defined as:
Replace(GetFieldSelections(pt_Segment),', ','","')
It's observed that when no selection is made in the filter, the resulting value is 0. But my requirement is if you don't pick anything from the filter, I want to include all values from the "pt_Segment" field.
Any help is greatly appreciated.
I assume that by adding a DISTINCT statement into the concat() by the suggestion from @qv_testing that the performance should be increase significantly.
Beside this you could simplify the approach by using p(), like:
Count({1< pt_Segment = p(pt_Segment) >} distinct pt_IPNO&pt_YHNO)
try this
=count({<pt_Segment={$(=concat(chr(39) & pt_Segment & chr(39),',') )}>}distinct pt_IPNO&pt_YHNO)))
It's working, but it's taking a really long time to load. Can you suggest a different approach?
=count({<pt_Segment={$(=concat(distinct chr(39) & pt_Segment & chr(39),',') )}>}distinct pt_IPNO&pt_YHNO)))
I assume that by adding a DISTINCT statement into the concat() by the suggestion from @qv_testing that the performance should be increase significantly.
Beside this you could simplify the approach by using p(), like:
Count({1< pt_Segment = p(pt_Segment) >} distinct pt_IPNO&pt_YHNO)
Thank you, it works!!
Since p()
works effectively, can it be considered as a replacement for the getfieldselection()
?
For the majority of use-cases p() could be regarded as replacement for getfieldselections() but the logic behind the features and their possibilities are different.
p() and it's reverse function e() return the possible/excluded index-values (only the TRUE/FALSE state of a value and not the values itself) and not the active selected values which means p() and e() are working against the entire data-set and not only against a single field.