Page Properties Report CQL on date?
Asked by tbellmr:

I can see that the include text filter is very close to what I need but not sure how to finalize my query.

I have page properties that include a custom "**Completed**" date field that I populate using the // calendar. If Completed is empty (null), it is not complete but if it is populated with a date then it is complete.

So how do I write the query to delineate between entries that have and do not have a complete date?

Your assistance will be very much appreciated! If there is another way to accomplish the same - I am interested in that too. I am a space admin so no user macros for me...


Answers:
author: Natalie Paramonova [Stiltsoft]
body: Hi [@tbellmr](/t5/user/viewprofilepage/user-id/3660824) ,

I think our [Table Filter and Charts for Confluence](https://marketplace.atlassian.com/apps/27447/table-filter-and-charts-for-confluence?hosting=server&tab=overview) app can help you resolve your use case.

The first option is to filter table data. Place the Page Properties Report macro (or a manually created table or other macros generating tables) in the [Table Filter](https://docs.stiltsoft.com/display/public/TFAC/How+to+use+Table+Filter+macro) macro body.

![2019-12-18_13h26_01.png](https://community.atlassian.com/t5/image/serverpage/image-id/76647i3C51BFD121F033DF/image-dimensions/578x257?v=v2 "2019-12-18_13h26_01.png")

Filter all the **not empty** values in the Completed column.

![2019-12-18_13h26_21.png](https://community.atlassian.com/t5/image/serverpage/image-id/76644i8FBCCF1ECE022CF0/image-dimensions/319x155?v=v2 "2019-12-18_13h26_21.png")

The second option is to add colorful statuses as indicators.

Place the Page Properties Report macro in the [Table Transformer](https://docs.stiltsoft.com/display/public/TFAC/How+to+use+Table+Transformer+macro) macro body. Add a small table with the Status macros.

![2019-12-18_13h31_16.png](https://community.atlassian.com/t5/image/serverpage/image-id/76645iEAC7C0EA5551EBEC/image-dimensions/745x462?v=v2 "2019-12-18_13h31_16.png")

Use the following SQL query that meets your conditions:

SELECT  
T1.'Task',  
T1.'Completed',  
CASE WHEN T1.'Completed' IS NULL THEN "INCOMPLETE" ELSE "COMPLETE" END AS 'Completion'  
FROM T1

![2019-12-18_13h31_33.png](https://community.atlassian.com/t5/image/serverpage/image-id/76646i6663FE2F187D3CE5/image-dimensions/766x418?v=v2 "2019-12-18_13h31_33.png")

Get the following result:

![2019-12-18_13h31_00.png](https://community.atlassian.com/t5/image/serverpage/image-id/76643i45A99FB6069F8B1D/image-dimensions/317x224?v=v2 "2019-12-18_13h31_00.png")

You can further filter, calculate and even build charts based on the Page Properties Report macro.

comments: author: tbellmr
body: HI Natalie, your table filter macro looks like it would do the trick. Unfortunately we do not have that licensed and looks like it would be very difficult to get anything purchased.

Just curious on the use of the T1 table in the SQL query in the Table Transformer macro - how did that table name get assigned?


author: Natalie Paramonova [Stiltsoft]
body: Hi [@tbellmr](/t5/user/viewprofilepage/user-id/3660824) ,

T1, T2, T3, etc. means the ordinal number of the table inside the Table Transformer macro. The macro provides the ability to merge multiple tables that's why there may be multiple tables within the macro body and we name them by their ordinal number.


author: themaxiyt2
body: la vida es mas ermosa que nada


Tags: confluence-server

server