Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
TIGERMG
Contributor II
Contributor II

INDEX function not working

Hi ALL,

 

I'm created 1 table with 12 columns and want to show dem on show / hide way on selection on MONTHYEAR fields.

so, for column condition I put below expression, it is working for any 6 selection in MONTHYEAR field but if i select any other MONTHYEAR field it wont work....... I found the issue that is Index become zero after 7 select.

 

If(Len(GetFieldSelections(MONTHYEAR))>0 and index(GetFieldSelections(MONTHYEAR), '$(vJan)')>0 , 1,0)

please suggest . Thank you in advance.

 

Labels (2)
2 Solutions

Accepted Solutions
tresesco
MVP
MVP

getfieldselections() has a third parameter for max value which is by default 6. If you need more values to be considered, you have to explicitly pass it. Try like:

If(Len(GetFieldSelections(MONTHYEAR , ',' , 100))>0 and index(GetFieldSelections(MONTHYEAR , ',' , 100), '$(vJan)')>0 , 1,0)

View solution in original post

tresesco
MVP
MVP

@TIGERMG , GetCurrentSelections() is not exactly similar to the earlier one. It doesn't have a field parameter, of course, you need all fields selection, so there is no point mentioning one. I suggest to always check qlik's official help site once you get a hint from community to understand better and resolve. Please check here : GetCurrentSelections | QlikView Help

 For this case, you may try like: 

=GetCurrentSelections(',','|','@',100)

 

View solution in original post

4 Replies
tresesco
MVP
MVP

getfieldselections() has a third parameter for max value which is by default 6. If you need more values to be considered, you have to explicitly pass it. Try like:

If(Len(GetFieldSelections(MONTHYEAR , ',' , 100))>0 and index(GetFieldSelections(MONTHYEAR , ',' , 100), '$(vJan)')>0 , 1,0)

TIGERMG
Contributor II
Contributor II
Author

Hi Tresesco,

Its working as per the requirement.

Thank you🙂 so much for your help.

 

TIGERMG
Contributor II
Contributor II
Author

Hi Tresesco,

I have created 1 field in backend i.e ACTUALS and again 1 table with 12 columns and want to show dem on show / hide way on selection on ACTUALS fields.

GetFieldSelections is not working so i take below GetCurrentSelections, its working but aging same not more than 6 selection even applying the same expression which u suggest earlier. 

If(Len(GetCurrentSelections(ACTUALS,',',100))>0 and index(GetCurrentSelections(ACTUALS,',',100), '$(v1)')>0 , 1,0)

Please suggest.

 

 

 

tresesco
MVP
MVP

@TIGERMG , GetCurrentSelections() is not exactly similar to the earlier one. It doesn't have a field parameter, of course, you need all fields selection, so there is no point mentioning one. I suggest to always check qlik's official help site once you get a hint from community to understand better and resolve. Please check here : GetCurrentSelections | QlikView Help

 For this case, you may try like: 

=GetCurrentSelections(',','|','@',100)