Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Everyone,
How can I setup the field dynamically using the button action (New version)
I do have a Button for navigation object (which was an older version button, currently this object is not available), to set up period values such as YTD, QTD, etc. Based on these period values, the button is setting up the field dynamically.
The older button has an action Define the field using the expression, the new button doesn't have this action.
I have added a few screens for reference.
Can you please help me to achieve this functionality or any alternatives if possible?
thanks in advance
Ramakoti
Hello @RK007
I wanted to take a shot at this and maybe help out or point in the right direction:
How to Select field Dynamically using the Button Action
To select a field dynamically using a button action in Qlik, you can use the "Select in Field" action. This action allows you to select one or more values in a field based on a condition.
Here's an example of how to use the "Select in Field" action to select a field dynamically using a button action in Qlik:
1. Create a button object in your Qlik app.
2. In the button properties, go to the "Actions" tab and click "Add".
3. Select "Select in Field" as the action type.
4. In the "Field" dropdown, select the field you want to select values from.
5. In the "Search String" box, enter the expression that defines the values you want to select dynamically. For example, you could use an if statement to select values based on a condition:
=if(period = 'YTD', 'YearToDate', if(period = 'QTD', 'QuarterToDate', ''))
(In this example, the "period" variable is used to determine which values to select in the "Field" dropdown. If "period" is "YTD", the expression selects all values in the "YearToDate" category. If "period" is "QTD", the expression selects all values in the "QuarterToDate" category. If "period" is anything else, the expression selects no values.)
6. Click "OK" to save the action and close the dialog.
7. Test the button by clicking it and verifying that the correct values are selected in the field.
Note that you can also use the "Toggle Select" action to select or deselect values in a field based on a condition. This can be useful if you want to allow the user to toggle between different sets of values in the same field.
Here are some additional sources:
thank you so much for your response, it helped me to make multiple selections.
But, I need more clarity on my primary requirement, I have added more info about my requirement.
how can select the field dynamically (the field is being created using the zBOSDate variable, we have created the flags for all the period values on the script side).
After selecting the period from the drop-down, if the user clicks on the button it's selecting the field based on the period and sets up the values in that field.
I am not able to achieve it, can you provide me with any solution or alternative for this?
I do have a Button for navigation object (which was an older version button, currently this object is not available), to set up period values such as YTD, QTD, etc.
It has 3 actions
1: Set Variable Value -
2: Clear Selections in a Field - using an action - Define the Field using an expression (this action is not available in the new button object) - this action clears the field selection based on the Period ranges
3: Select a value in a Field - using an action - Define the Field using an expression (this action is not available in the new button object)
This action sets up the field based on the selection in the period drop-down (YTD, QTD, etc, variable is zBOSStateBCalendarField), for all these periods, we have created flags in the script level to set up the date ranges.
currently, these are not working, can anybody helps me to find a better solution to achieve this functionality?
let me know if any further info is required...
do you have any solution or any alternative for the above problem?
I really appreciate any help you can provide.