You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: site/sigmaguides/src/Fundamentals 6: Controls - v3/fundamentals_6_controls.md
+6-29Lines changed: 6 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,7 +27,7 @@ To read more about [creating flexible reports with parameters, see here.](https:
27
27
28
28
If you already completed QuickStart fundamentals 1-5, you have already used controls.
29
29
30
-
In [Fundamentals 2 - Data](http://localhost:8000/guide/fundamentals-2-data/index.html?index=..%2F..index#2), we created a filter directly from a table column (Store Region), and converted that filter into a page control. This control is an example of a `List control`.
30
+
In [Fundamentals 2 - Data](https://quickstarts.sigmacomputing.com/guide/fundamentals_2_data_v3/index.html?index=..%2F..index#2), we created a filter directly from a table column (Store Region), and converted that filter into a page control. This control is an example of a `List control`.
31
31
32
32
Selecting the correct control is often more art than science, as there are many controls to choose from.
33
33
@@ -294,7 +294,7 @@ Also notice that the `DATA SOURCE` indicates `+ 1` to let us know that there is
294
294
<imgsrc="assets/fcontrols_19.png"width="800"/>
295
295
296
296
### Add the switch control
297
-
Add a `Switch` control to the page, rename it `Transaction Type` and set it's `Control ID` to `f6-c-switch-transaction-type`.
297
+
Add a `Switch` control to the page, rename it `Transaction Type` and set it's `Control ID` to `f6-c-switch-transaction-type` and the `Filter Type` to `True/False`.
298
298
299
299
We can now toggle the switch control on and off, but the table is "aware" of it yet.
300
300
@@ -303,43 +303,20 @@ We need to make the table respond to this controls value, as it is changed.
303
303
Add a new column next to `Transaction Type`, rename it to `Switch`, and set its formula to:
You can also change the control labels under `Format` > `LABEL` to replace On/Off with Purchase/Return.
310
+
309
311
<imgsrc="assets/fcontrols_20.png"width="650"/>
310
312
311
313
<asideclass="negative">
312
314
<strong>NOTE:</strong><br> This function allows for dynamic filtering based on the state of a switch control and the type of transaction. When the switch is TRUE, it filters for “Purchase” transactions. When the switch is FALSE, it filters for “Return” transactions.
313
315
</aside>
314
316
315
-
#### How It Works in Detail:
316
-
<li><strong>When [f6-c-switch-transaction-type] is TRUE:</strong>
317
-
<ul>
318
-
<li>The function checks if Transaction Type is “Purchase”.</li>
319
-
<li>If Transaction Type is “Purchase”, the function returns TRUE.</li>
320
-
<li>If Transaction Type is not “Purchase”, the function returns FALSE.</li>
321
-
</ul>
322
-
</li>
323
-
<li><strong>When [switch-example] is FALSE:</strong>
324
-
<ul>
325
-
<li>The function checks if Transaction Type is “Return”.</li>
326
-
<li>If Transaction Type is “Return”, the function returns TRUE.</li>
327
-
<li>If Transaction Type is not “Return”, the function returns FALSE.</li>
328
-
</ul>
329
-
</li>
330
-
</ul>
331
-
332
317
<imgsrc="assets/horizonalline.png"width="800"/>
333
318
334
-
The last step is to add a table filter on the `Switch` column so that it responds to changes from the control.
335
-
336
-
Be sure to select only the True value, as that is what the control should be set to while we create this filter.
337
-
338
-
<asideclass="negative">
339
-
<strong>NOTE:</strong><br> We made sure all the other controls we set to allow all 4.5M rows appear in the table. You may have to refresh your browser if they count is not as expected, once the controls are set.
340
-
</aside>
341
-
342
-
<imgsrc="assets/fcontrols_21.png"width="650"/>
319
+
In the switch controls configuration, add the `PLUGS_SALES` table as a `TARGET` and select the `Switch` column under that.
343
320
344
321
Now we can toggle between `Purchase` and `Return` transactions:
0 commit comments