Report studio value hint to SQL query via prompt macro function

Source: Internet
Author: User

Scenario: When we create a new table in the DW, but there is no model created in FM, and want to do a report directly for this table, then we need to query directly with SQL in Reportstudio, in order to pursue the query speed, we can pass the conditions of the page user selection directly to SQL.

For example: above is the province corresponding key value is 1-2-3-4-5, the following is the product type corresponding key value is 1-2, the province select 1,5 type Select 1 to appear the desired data

Implementation steps:

1: Drag a SQL from the toolbox, and each SQL binds a query that receives SQL query results, such as

2: Specify the data source for SQL Reference, the data source has been created in cognosconnection, to choose

3: Write the following in SQL

SELECT * from Testorder t where t.ordertype= #prompt (' OrderType ', ' Integer ') #

and T.orderprovince in (#promptmany (' Pkey ', ' Integer ') #)

Analytical:

#prompt (' OrderType ', ' Integer ') # The first parameter is the parameter name for the value hint, the second argument is a date type

#promptmany (' Pkey ', ' Integer ') #针对值提示可多选的时候, the first parameter is the parameter name, the second argument is the date type

PS: The macro function can also be used in the Model Designer FM, friends who have fun can do their own group to study.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.