Dashboard Card - LiquidAnalytics/ld-api-examples GitHub Wiki

#Dashboard Card Configuration ##Description / Overview

  1. This is the specification for the “Configuring Dashboard Cards”
  2. Dashboard Card is always found in a Card where information in the card is taken using function.
  3. The Dashboard Cards are of 3 Types
  4. DashboardInfoCard
  5. KVCard
  6. DialCard

##Dashboard Cards ###DashboardInfoCard

  1. The dashboard InfoCard has a title, subtitle and the count of that parameter.

  2. Steps To Create a DashboardInfoCard:-

  3. Create a canvasCard item with a unique canvasCardId (eg dashboard.card1), canvasCardType = DashboardInfoCard, DataGridDefId (pivot.dataGrid1), pivotReportId (pivot.Report1), order any integer, parentInsightPop (gadgetId of appDef Item dashboard)

  4. Create a DashboardInfoCard item where dashboardInfoCardId = canvasCardId (dashboard.card1), functionId (dashboard.card1), title as required (eg Card 1), and subtitle (eg currentYear() “ - ” currentMonth())

  5. Create a Function item where functionId = DashboardInfoCard.functionId (dashboard.card1), functionType = "/Function/functionType[RDSQuery]”, itemType = “KeyValue”, and function = a sql Query which would have values for h_id, h_clientId, key, and value (eg xx as h_id, yy as h_clientId, zz as key, and abc as value).

  6. as seen in the eg below this Dashboard InfoCard displays the Sales Quotes amount for July 2015.

###KVCard

  1. The KVcard has a title and various key value pairs on the Card.

  2. Steps To Create a KVCard:-

  3. Create a canvasCard item with a unique canvasCardId (eg dashboard.card2), canvasCardType = KVCard, DataGridDefId (pivot.dataGrid2), pivotReportId (pivot.Report2), order any integer, parentInsightPop (gadgetId of appDef Item dashboard)

  4. Create a KVCard item where kvCardId = canvasCardId (dashboard.card2), functionId (dashboard.card2), title as required (eg Card 2), and subtitle (eg currentYear() “ - ” currentMonth())

  5. Create a Function item where functionId = KVCard.functionId (dashboard.card2), functionType = "/Function/functionType[RDSQuery]”, itemType = “KeyValue”, and function = a sql Query which would have values for h_id, h_clientId, key, and value (eg xx as h_id, yy as h_clientId, zz as key, and abc as value) and repeat the same fields joined by Union all of get various rows in the cards (eg below has 3 rows so 1 set of values Union All 2nd set of values Union All 3rd set).

  6. Below the title then are sub parameters that is been considered eg Promotions and the count or values associated to it.

###DialCard

  1. A Dial Card has a title and a gauge that starts with a min value and ends at max value. It displays 3 counts within the gauge Low, Target, and High (these are the expected values or the counts associated with goal). And in the center and on the gauge there will be actual achieved count been displayed.
  2. Values Low, Target, and High should always be in the order Low<Target<High.
  3. And depending on the actual count the color on the gauge is decided.
  4. If actual count less than Low then Red color
  5. If actual count Greater than Low but less than Target then Yellow
  6. If actual count Greater than Target but less than High then Blue
  7. If actual count Greater than High then Green
  8. Steps To Create a DialCard:-
  9. Create a canvasCard item with a unique canvasCardId (eg dashboard.card3), canvasCardType = DialCard, DataGridDefId (pivot.dataGrid3), pivotReportId (pivot.Report3), order any integer, parentInsightPop (gadgetId of appDef Item dashboard)
  10. Create a DialCard item where DialCardId = canvasCardId (dashboard.card3), functionId (dashboard.card3).
  11. Create a Function item where functionId = DialCard.functionId (dashboard.card3), functionType = "/Function/functionType[RDSQuery]”, itemType = “DialData”, and function = a sql Query which would have values for h_id, h_clientId, title, label, min, low, target, high, and max (eg aa as h_id, bb as h_clientId, cc as title, dd as label, 0 as min, 15 as low, 25 as target, 35 as high, and 50 as max).
  12. As seen in e.g. below there is a gauge that has a low of 15 projects, Target of 20 projects and High of 30 projects and for the current month only 2 new projects are been created. Since the value is less than low so the gauge is visible in Red.

##Some common mistakes related to Dashboard Cards ###Dial Gauge value does not exist. It is possible that some value that function is counting is null value or blank so in function add a condition for value Case when value = “” then “Undefined” else value End as value.

###Dial Card or KVCard Value does not show up The key and value for dialCard or KVCard can be a numeric value or date or even if in a string format but in function one should convert it to citext using ::citext after the value eg: h_updatedAt::citext as value this will convert it to case insensitive text format.