{"id":1584,"date":"2021-11-04T09:20:05","date_gmt":"2021-11-04T00:20:05","guid":{"rendered":"https:\/\/kintools.com\/?post_type=docs&#038;p=1584"},"modified":"2021-11-05T14:34:05","modified_gmt":"2021-11-05T05:34:05","password":"","slug":"conditional-expressions","status":"publish","type":"docs","link":"https:\/\/kintools.com\/en\/docs\/conditional-expressions\/","title":{"rendered":"Conditional expression"},"content":{"rendered":"<p class=\"wp-block-paragraph\">Conditional expressions are not allowed in Stimulsoft reports by default. However, there are two ways to force conditional behavior as needed.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>IIF function<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">First, a built-in that can be inserted from the data dictionary<strong>IIF<\/strong>You can use the function. This function uses the following syntax:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">{IIF (condition, value 1, value 2}<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It evaluates the Condition, and if Condition returns true, the expression returns Value1. If false is returned, Value2 is returned. For example, if you enter the following formula:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Number of stores: {Store.Count&gt; 0? Store.Count: \u201cNone\u201d}<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If the Store.Count value is 10 after the calculation, the result displayed in the report will be:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Number of stores: 10<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If the value of Store.Count is 0 after the calculation, the result displayed in the report is as follows.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Number of stores: None<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>C # ternary operator<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It is also possible to use the ternary operator with C # as the reporting language if you are using it. The syntax for the ternary operator is:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">{situation ? Value 1: Value 2}<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">As with the IIF function, if Condition evaluates to true, the expression returns Value1. If false, returns Value2.<\/p>","protected":false},"excerpt":{"rendered":"<p>\u6761\u4ef6\u5f0f\u306f\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u306fStimulsoft\u30ec\u30dd\u30fc\u30c8\u3067\u306f\u8a31\u53ef\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002\u305f\u3060\u3057\u3001\u5fc5\u8981\u306b\u5fdc\u3058\u3066\u6761\u4ef6\u4ed8\u304d\u52d5\u4f5c\u3092 [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"ocean_post_layout":"","ocean_both_sidebars_style":"","ocean_both_sidebars_content_width":0,"ocean_both_sidebars_sidebars_width":0,"ocean_sidebar":"","ocean_second_sidebar":"","ocean_disable_margins":"enable","ocean_add_body_class":"","ocean_shortcode_before_top_bar":"","ocean_shortcode_after_top_bar":"","ocean_shortcode_before_header":"","ocean_shortcode_after_header":"","ocean_has_shortcode":"","ocean_shortcode_after_title":"","ocean_shortcode_before_footer_widgets":"","ocean_shortcode_after_footer_widgets":"","ocean_shortcode_before_footer_bottom":"","ocean_shortcode_after_footer_bottom":"","ocean_display_top_bar":"default","ocean_display_header":"default","ocean_header_style":"","ocean_center_header_left_menu":"","ocean_custom_header_template":"","ocean_custom_logo":0,"ocean_custom_retina_logo":0,"ocean_custom_logo_max_width":0,"ocean_custom_logo_tablet_max_width":0,"ocean_custom_logo_mobile_max_width":0,"ocean_custom_logo_max_height":0,"ocean_custom_logo_tablet_max_height":0,"ocean_custom_logo_mobile_max_height":0,"ocean_header_custom_menu":"","ocean_menu_typo_font_family":"","ocean_menu_typo_font_subset":"","ocean_menu_typo_font_size":0,"ocean_menu_typo_font_size_tablet":0,"ocean_menu_typo_font_size_mobile":0,"ocean_menu_typo_font_size_unit":"px","ocean_menu_typo_font_weight":"","ocean_menu_typo_font_weight_tablet":"","ocean_menu_typo_font_weight_mobile":"","ocean_menu_typo_transform":"","ocean_menu_typo_transform_tablet":"","ocean_menu_typo_transform_mobile":"","ocean_menu_typo_line_height":0,"ocean_menu_typo_line_height_tablet":0,"ocean_menu_typo_line_height_mobile":0,"ocean_menu_typo_line_height_unit":"","ocean_menu_typo_spacing":0,"ocean_menu_typo_spacing_tablet":0,"ocean_menu_typo_spacing_mobile":0,"ocean_menu_typo_spacing_unit":"","ocean_menu_link_color":"","ocean_menu_link_color_hover":"","ocean_menu_link_color_active":"","ocean_menu_link_background":"","ocean_menu_link_hover_background":"","ocean_menu_link_active_background":"","ocean_menu_social_links_bg":"","ocean_menu_social_hover_links_bg":"","ocean_menu_social_links_color":"","ocean_menu_social_hover_links_color":"","ocean_disable_title":"default","ocean_disable_heading":"default","ocean_post_title":"","ocean_post_subheading":"","ocean_post_title_style":"","ocean_post_title_background_color":"","ocean_post_title_background":0,"ocean_post_title_bg_image_position":"","ocean_post_title_bg_image_attachment":"","ocean_post_title_bg_image_repeat":"","ocean_post_title_bg_image_size":"","ocean_post_title_height":0,"ocean_post_title_bg_overlay":0.5,"ocean_post_title_bg_overlay_color":"","ocean_disable_breadcrumbs":"default","ocean_breadcrumbs_color":"","ocean_breadcrumbs_separator_color":"","ocean_breadcrumbs_links_color":"","ocean_breadcrumbs_links_hover_color":"","ocean_display_footer_widgets":"default","ocean_display_footer_bottom":"default","ocean_custom_footer_template":"","footnotes":""},"doc_category":[65],"doc_tag":[],"class_list":["post-1584","docs","type-docs","status-publish","hentry","doc_category-expressions","entry"],"year_month":"2026-05","word_count":27,"total_views":0,"reactions":{"happy":0,"normal":0,"sad":0},"author_info":{"name":"yuko.imai","author_nicename":"yuko-imai","author_url":"https:\/\/kintools.com\/en\/author\/yuko-imai\/"},"doc_category_info":[{"term_name":"\u5f0f","term_url":"https:\/\/kintools.com\/en\/docs-category\/expressions\/"}],"doc_tag_info":[],"_links":{"self":[{"href":"https:\/\/kintools.com\/en\/wp-json\/wp\/v2\/docs\/1584","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kintools.com\/en\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/kintools.com\/en\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/kintools.com\/en\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/kintools.com\/en\/wp-json\/wp\/v2\/comments?post=1584"}],"version-history":[{"count":4,"href":"https:\/\/kintools.com\/en\/wp-json\/wp\/v2\/docs\/1584\/revisions"}],"predecessor-version":[{"id":1727,"href":"https:\/\/kintools.com\/en\/wp-json\/wp\/v2\/docs\/1584\/revisions\/1727"}],"wp:attachment":[{"href":"https:\/\/kintools.com\/en\/wp-json\/wp\/v2\/media?parent=1584"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/kintools.com\/en\/wp-json\/wp\/v2\/doc_category?post=1584"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/kintools.com\/en\/wp-json\/wp\/v2\/doc_tag?post=1584"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}