Database Reference
In-Depth Information
This query will contain logic that will count the number of orders that took under ten
days to close.
Step 3: Build the Query Logic
1.
Double-click the 0-10 query to access the query build window.
2.
From the Source tab of the Insertable Objects pane, drag the Date query item from the
Time query subject into the Data Items pane.
IBM COGNOS 8 NOTE
The Time query subject is called Time Dimension .
3.
Drag the Date (close date) query item from the Time (close day) query subject into the
Data Items pane.
COGNOS 8 NOTE
The Date (close date) query item is called Date (close day) .
4.
From the To o l b o x tab of the Insertable Objects pane, drag a Data Item into the Data
Items pane.
The Data Item Expression dialog box opens.
5.
Create the following expression:
_days_between([Date (close date)],[Date])
This expression will return the number of days it took to close the order.
TIP Yo u c a n t y p e t h e e x p r e s s i o n o r d r a g a n d d r o p t h e _days_between function from the
functions tab in the available components pane and the two data items that are used as the
arguments in the function from the data items tab of the available components pane.
6.
Va l i d a t e t h e e x p r e s s i o n a n d c l i c k OK .
7.
Rename the DataItem1 data item to DaysBetween .
8.
From the To o l b o x tab of the Insertable Objects pane, drag another Data Item into the
Data Items pane below the DaysBetween data item.
9.
In the Data Item Expression dialog box, create the following expression:
if([DaysBetween]<11)
then (1)
else (0)
This expression will count the record if there have been fewer than 11 days between the
time the order was placed and the time it was closed. The function will be applied to
 
 
Search WWH ::




Custom Search