{"id":29225,"date":"2021-07-30T10:45:51","date_gmt":"2021-07-30T09:45:51","guid":{"rendered":"https:\/\/multisite.korebots.com\/?p=29225"},"modified":"2021-08-14T09:34:18","modified_gmt":"2021-08-14T08:34:18","slug":"table-views","status":"publish","type":"post","link":"https:\/\/developer.kore.ai\/v9-0\/docs\/bots\/advanced-topics\/table-views\/","title":{"rendered":"Table Views"},"content":{"rendered":"<section class=\"l-section wpb_row height_auto\"><div class=\"l-section-h i-cf\"><div class=\"g-cols vc_row type_default valign_top\"><div class=\"vc_col-sm-12 wpb_column vc_column_container\"><div class=\"vc_column-inner\"><div class=\"wpb_wrapper\">\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<p>Table Views let you create custom datasets by joining one or more Data Tables. These definitions get converted to queries to extract data from one or more data tables by using the required joins.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Definition\">Definition<\/span><\/h2>\n<p>View definition includes:<\/p>\n<ul>\n<li><strong>Name<\/strong> for the view.<\/li>\n<li><strong>Description<\/strong> of the view<\/li>\n<li><strong>Assignment<\/strong> of Bot and Apps to access the View<br \/>\n<a ref=\"magnificPopup\" href=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v9-0\/wp-content\/uploads\/sites\/21\/20210624125645\/data_views.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-28026\" src=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v9-0\/wp-content\/uploads\/sites\/21\/20210624125645\/data_views.png\" alt=\"\" width=\"1365\" height=\"291\" srcset=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v9-0\/wp-content\/uploads\/sites\/21\/20210624125645\/data_views.png 1365w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v9-0\/wp-content\/uploads\/sites\/21\/20210624125645\/data_views-300x64.png 300w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v9-0\/wp-content\/uploads\/sites\/21\/20210624125645\/data_views-1024x218.png 1024w\" sizes=\"auto, (max-width: 1365px) 100vw, 1365px\" \/><\/a><\/li>\n<li>A View can be built from a <strong>Single Table<\/strong> or <strong>Multiple Tables<\/strong>.\n<ul>\n<li>For both types,\u00a0you need to\n<ul>\n<li>select the <strong>table;<\/strong><\/li>\n<li>select the <strong>columns<\/strong> to be included in the view, you can use aggregation functions like <code>sum, avg, min, max and count<\/code>. Usage example: <code>count(&lt;table_name&gt;.&lt;column_name&gt;)<\/code><\/li>\n<li>the <strong>criteria for filtering<\/strong> the results using\n<ul>\n<li>column name &#8211; select from the drop-down list;<\/li>\n<li>comparison operator &#8211; select from =, !=, &lt; or &gt;<\/li>\n<li>comparison value<\/li>\n<li>you can have multiple filter criteria connected by AND\/OR operators<\/li>\n<\/ul>\n<\/li>\n<li>the <strong>Group By<\/strong> columns for arranging the identical data into groups as <code>&lt;table_name&gt;.&lt;column_name&gt;<\/code>, and<\/li>\n<li>the <strong>Sort By<\/strong> columns to order the results as <code>&lt;table_name&gt;.&lt;column_name&gt; asc\/desc<\/code><\/li>\n<\/ul>\n<p><a ref=\"magnificPopup\" href=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v9-0\/wp-content\/uploads\/sites\/21\/20210624125728\/data_views_single.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-28028\" src=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v9-0\/wp-content\/uploads\/sites\/21\/20210624125728\/data_views_single.png\" alt=\"\" width=\"679\" height=\"693\" srcset=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v9-0\/wp-content\/uploads\/sites\/21\/20210624125728\/data_views_single.png 679w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v9-0\/wp-content\/uploads\/sites\/21\/20210624125728\/data_views_single-294x300.png 294w\" sizes=\"auto, (max-width: 679px) 100vw, 679px\" \/><\/a><\/li>\n<li>In addition, for multiple tables view, you need to specify the <strong>Join<\/strong> criteria by configuring\n<ul>\n<li><strong>Table<\/strong> to be joined;<\/li>\n<li>the\u00a0<strong>type of join<\/strong>&#8211; inner, right outer or left outer;<\/li>\n<li>the <strong>join columns<\/strong> &#8211; pick from the drop-down list and<\/li>\n<li>specify the <strong>join criteria<\/strong> using the operation =, !=, &gt; or &lt; operators.<\/li>\n<li>You can have multiple Join Rules. You can have up to 4 join rules.<\/li>\n<\/ul>\n<p><a ref=\"magnificPopup\" href=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v9-0\/wp-content\/uploads\/sites\/21\/20210624125755\/data_views_mult.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-28030\" src=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v9-0\/wp-content\/uploads\/sites\/21\/20210624125755\/data_views_mult.png\" alt=\"\" width=\"684\" height=\"899\" srcset=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v9-0\/wp-content\/uploads\/sites\/21\/20210624125755\/data_views_mult.png 684w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v9-0\/wp-content\/uploads\/sites\/21\/20210624125755\/data_views_mult-228x300.png 228w\" sizes=\"auto, (max-width: 684px) 100vw, 684px\" \/><\/a><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div><\/div><\/div><\/div><div class=\"vc_col-sm-12 wpb_column vc_column_container\"><div class=\"vc_column-inner\"><div class=\"wpb_wrapper\"><\/div><\/div><\/div><\/div><\/div><\/section>\n","protected":false},"excerpt":{"rendered":"Table Views let you create custom datasets by joining one or more Data Tables. These definitions get converted to queries to extract data from one or more data tables by using the required joins. Definition View definition includes: Name for the view. Description of the view Assignment of Bot and Apps to access the View...","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[15],"tags":[],"class_list":["post-29225","post","type-post","status-publish","format-standard","hentry","category-advanced-topics"],"_links":{"self":[{"href":"https:\/\/developer.kore.ai\/v9-0\/wp-json\/wp\/v2\/posts\/29225","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/developer.kore.ai\/v9-0\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/developer.kore.ai\/v9-0\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v9-0\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v9-0\/wp-json\/wp\/v2\/comments?post=29225"}],"version-history":[{"count":1,"href":"https:\/\/developer.kore.ai\/v9-0\/wp-json\/wp\/v2\/posts\/29225\/revisions"}],"predecessor-version":[{"id":30971,"href":"https:\/\/developer.kore.ai\/v9-0\/wp-json\/wp\/v2\/posts\/29225\/revisions\/30971"}],"wp:attachment":[{"href":"https:\/\/developer.kore.ai\/v9-0\/wp-json\/wp\/v2\/media?parent=29225"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/developer.kore.ai\/v9-0\/wp-json\/wp\/v2\/categories?post=29225"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/developer.kore.ai\/v9-0\/wp-json\/wp\/v2\/tags?post=29225"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}