# QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Support Cases coming to Qlik Community Oct. 4! Start chats, open cases, explore resources: READ DETAILS
cancel
Showing results for
Did you mean:
Not applicable

## Finding the count of days in the current month where a goal is reached

Hi Community,

In our data, I have the number of tests we run per day, and the number of each of these that fail.  Our goal is, say, 99.5%

So successrate is 1-( sum(errors) / sum(tests) )

I need to sum tests and errors by date, then count the number of days this month that the successrate is >= 99.5%

Do I need to group the stats in the load script by day?  If so, how?  Also, We have only test timestamp, which I have rounded to daystart in the load statement.

Hope that makes sense!

4 Replies
Specialist II

HI,

I would calculate 1-(sum(errors) / sum(tests)) in the load statement, grouping by day, for example calling it Goal

I don´t know how do you want to create the table to visualize data,but I wolud create a pivot table with two dimensions: month and date

If you select partial sums for date dimension, you can do something like this in one expression:

if( Dimensionallity() = max(Dimensionallity() ), Goal,

count({<Goal={'>=0.995'}total Goal))

so in one column, you will have each goal for each date and in total line you will have the total count of goals >=99.5% for each month.

I´m not sure if this will work exactly, but I want you to give an idea, hope it´s usefull

Regards,

Chema

Not applicable
Author

Unfortunately, I can't use a pivot table - they want the column added to an existing straight table.

If I create the daily results value in the load script, how would I use it?  I'll look up the syntax for group by.

I picture another table, with only these fields:  Date, TestName, sum(tests), sum(errors), ResultsPct.  Then I could link the field TestName to the main table on testname.  I will have to work on ensuring it's only one field to link (and not, say, test+productname)...

Thanks again!

Specialist II