Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Creating Custom Queries in Report Builder with LQE Data Source

We are currently in the process of migrating from a Data Warehouse to a Lifecycle Query Engine data source. We have a number of report utilising custom queries and I am struggling to migrate even the most basic of queries.


Assuming I have a Requirement artifact with a Source ID attribute. There are 1000 artifacts, 450 have a Source ID of "A" and 300 have a Source ID of "B".

I have tried using the following:

1. COUNT(IF(LCASE($Requirement:Source ID$) = "a", 1, ""))

2. COUNT(DISTINCT IF(LCASE($Requirement:Source ID$) = "a", $Requirement:Id$, ""))

Query 1 returns 750, i.e. the number of Requirement artifacts where Source ID exists, not just Source ID = "A"

Query 2 return 451, i.e. all the distinct IDs where Source ID = "a" plus 1 for represented by the failure case.

I have also tried using:

SUM(IF(LCASE($Requirement:Source ID$) = "a", 1, 0))

However, this returns a blank value.

This seems like a ridiculously simple thing to do but I cannot find the answer and daren't attempt any of the actual more complex expressions that I need to convert. I know I could build this example just using the "Calculated Value" option but I am trying to do this to learn the basics, and I know I could filter the data in Choose data page but I want to be able to report on multiple metrics in one report so that is not an option.

Any help or pointers to useful resources online would be greatly appreciated!

0 votes



2 answers

Permanent link
Just a note - each of your examples you're using LCASE() to convert the value to lower case, but in two out of three you're then comparing it to the  upper case "A"

The one that worked is using the lower case letter

1 vote


Permanent link

Further info:


When using the expression COUNT(IF(LCASE($Requirement:Source ID$) = "A", 1, ""))

If I include the Source ID as an attribute to display in the report I get the following output:

Row | Source ID | Custom Expression
-----|------------|-----------------------
  1    |                    |               0 
  2    |          A       |               450
  3    |          B       |                300

So if I display the Source ID it can count it correctly, but if I don't it provides the combined value??

0 votes

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 12,096

Question asked: May 06, 1:43 p.m.

Question was seen: 771 times

Last updated: May 08, 6:40 a.m.

Confirmation Cancel Confirm