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

Check if item is disabled or enabled

danosoft_0-1673627911988.png

This is the situation: when i enter in my sheet, I have an action that selects the writing CRE, consequently I would like to select the year 2023 but for CRE the year 2023 is not selectable becouse without data..... there is a way to test that in the YEAR field the value 2023 is NOT selectable and so I automatically select 2022?

Thanks

Labels (1)
1 Solution

Accepted Solutions
rubenmarin

Try with Max({<FieldName={'CRE'}>}Year).

Instead of 'FieldName' use the name of the field where CRE is selected.

View solution in original post

8 Replies
rubenmarin

Hi, one you have CRE selected, the next action can just select the value =Max(YEAR).

Besides that the check could be the same: If(Max(Year)<2023, '2023 not selectable', '2023 selectable)

or: If(Max({<FieldName={'CRE'}>}Year)<2023, '2023 not selectable', '2023 selectable)

danosoft
Specialist
Specialist
Author

Thanks you but if i put the 2 soluntions i have an error: Error in expression: ')' expected

rubenmarin

Hi, I missed a simple quote after selectable in both options:

If(Max({<FieldName={'CRE'}>}Year)<2023, '2023 not selectable', '2023 selectable')

danosoft
Specialist
Specialist
Author

Thanks you, but the problem is..... if i put the Max(YEAR) in a text box after i choice CRE is say me right solution 2022, but if i put like an ACTION in the open Sheet.... it choose 2023 and not 2022... why??

danosoft_0-1673879885879.png

and i need choice that opening my sheet so in the action

rubenmarin

Try with Max({<FieldName={'CRE'}>}Year).

Instead of 'FieldName' use the name of the field where CRE is selected.

danosoft
Specialist
Specialist
Author

I accept as the solution, thanks... it have only a problem, it work always except the first time i go in the sheet (but strange becouse the text box where i show the value it say me the correct value 2022).... all the others times it work

rubenmarin

Maybe the sheet has other actions, or there are another actions set, or macros that changes the value the first time is open.

Also I see in the image that it shows the YEAR field with a red line, meaning that there is no field with that name, maybe that what's failing in the previous post.

danosoft
Specialist
Specialist
Author

nono, that only becouse i traslate in english the field for this post, becouse my field name is in italian ANNO