Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
vishalgoud
Creator III
Creator III

is it possible to use alternate states with Getselected function in Expressions in Qv 11 SR10...?

Hi All,

Facing issue with the alternate states and Get selected function...

Is it possible to use alternate states in Expression which are having Getselected Functions...???

If Possible what is the Syntax we have to use for that....?? If not possible what is the alternate ...???

Need to use some other functions other than this Getselected  functions...???

Please check the Below Expression and Correct me if needed...we are unable to get any data...

if( GetSelectedCount(ENV ,'[Local 1]') =1  and GetSelectedCount(YEAR ,'[Local 1]')= 1  and GetSelectedCount(MONTH ,'[Local 1]') = 1 ,

Sum( {'[Local 1]' < REPORT_ID  = {"1"} , MONTH = $:: {">=$(= addmonths(Max(MONTH ),-2)) <=$(= addmonths(Max(MONTH),0))"}, SOURCE_ID =$::{"1"}, TARGET_ID =$::{"2"}

,DATE = $:: DATE >} SOURCE_COUNT) ) , Sum([Local 1]{< REPORT_ID = $:: {"1"} , SOURCE_ID = $:: {"1"}, TARGET_ID = $:: {"2"} , DATE = $:: DATE >} SOURCE_COUNT) ...

Best Regards,

V.

1 Reply
swuehl
MVP
MVP

The alternate state should be the third argument:

getselectedcount (FieldName [, IncludeExcluded [, State]])

Returns the current number of selected values in a field. It is possible to query an alternate state.

If IncludeExcluded is true the count will include selected values, which are currently excluded by selections in other fields. If false or omitted these values will not be included.

State is the alternate state to query.

Examples

getselectedcount ( Year )

getselectedcount ( Year, true( ) )

Hence, use something like

GetSelectedCount(ENV ,false(), '[Local 1]')