Forum Discussion

AnnaNguyen's avatar
AnnaNguyen
Data Storage
12-09-2023

How to use Blox to incorporate dynamic count based on Sisense functions to TextBlock

To add dynamic count Count([id]) to the widget, I just simply type {panel:Count} (screenshot 1).

 

For complex Sisense function (please see my screenshot 2 below) like this one: avg(DDiff([Days in effective_end_date],[Days in effective_start_date])), each record ID will have this function applied (i.e. record ID 1 with ddiff is 200, record ID 2 with ddiff is 100, record ID 3 with ddiff is -100, etc), and I want to get count of all record IDs where each of their avg(DDiff([Days in effective_end_date],[Days in effective_start_date])) IS LESS THAN 0, in that case, how do I add it to Sisense Blox textblock widget? 

Thanks for reviewing. Please let me know if more clarity or verbal talk is needed. 

2 Replies

Replies have been turned off for this discussion
  • soniya01's avatar
    soniya01
    Data Storage
    1. Data Preparation:

      • Ensure that your data source is connected and contains the information you want to count.
    2. Create a Metric or Measure:

      • In Sisense, create a metric or measure using Sisense functions to calculate the count dynamically. For example, if you want to count the number of orders, you might use a function like COUNT([OrderID]).
    3. Add a TextBlock:

      • In your Sisense dashboard, add a TextBlock widget or element where you want to display the dynamic count.
    4. Bind TextBlock to the Metric:

      • Configure the TextBlock to be dynamically linked to the metric or measure you created. This typically involves using a binding or referencing the metric directly.
    5. Refresh and Display:

      • Save your changes and refresh the dashboard. The TextBlock should now display the dynamic count based on the Sisense function.
    • AnnaNguyen's avatar
      AnnaNguyen
      Data Storage

      Thank you for the response, this is very helpful for me. While this helps me add Blox widget with a simple Sisense function such as counting COUNT([OrderID]), I can just simply do "text": "{panel:Count}". 

      However, for complex Sisense function (please see my screenshot 2 above) like this one: avg(DDiff([Days in benefit_effective_date],[Days in birth_date])), each record ID will have this function applied (i.e. record ID 1 with ddiff is 200, record ID 2 with ddiff is 100, record ID 3 with ddiff is -100, etc), and I want to get count of all record IDs where each of their avg(DDiff([Days in benefit_effective_date],[Days in birth_date])) LESS THAN 0, in that case, how do I add it to Sisense Blox textblock widget?