Start/Stop buttons v1.34.0
This example showcases how the Data+ Table can be setup to look like simple buttons, with no table design visible. Clicking the start button will save the start time and change the status. Which means that we will require a db table with two columns status
and start_time
.
- Let’s start by setting up a table with one row, two buttons and two text (no input) fields:
- Hide the dimension and change the buttons design:
- Enable save on entry so that clicking a button will save data immediately.
- Next we create some rules to actually set the status and start time:
When we press the start button, we want to set thestatus
to running and thestart_time
to the current time.
Same goes for the stop button, we want to set thestatus
to stopped and clear thestart_time
.
Lastly we want the start button not to be clickable while it is running, so we disable the column. Same goes for the stop button.
This will give us working buttons. Let’s try it out:
- It still looks like a table though, so we are going to change the appearance next:
- Change the size
- Disable Qliks default object background and remove all borders
- Hide the info bar
- Hide the table header
- General appearance settings
- Change the size
The result:
- For the last step, we do not want the
status
andstart_time
in separate columns.
Since these columns are Data+ columns though, we cannot simply combine them in the column settings as one might do with two dimensions. We will have to create a rule for that:
=If('$(status)'='running','$(status) since $(start_time)','$(status)')
This rule will overwrite the text in column status
. The value is calculated with an Qlik expression using the values of the status
and start_time
columns.
Please note:
Our table has only one row and uses no dimensions that will be affected by selections, therefore the rule will not have any impact on performance. Otherwise it is not recommended to use a Qlik expression value in combination with has value triggers.
Result:
- Finally let’s hide the
start_time
column and adjust thestart
column:
Leaving us with: