Announcements
Join us on Sept. 17 to hear how our new GenAI Assistant empowers data professionals: REGISTER
cancel
Showing results for
Did you mean:
Anonymous
Not applicable

## Creating a measure based on set time periods.

I am trying to create a measure for 3 gauge chart showing me % on time deliveries. A gauge chart for each time period of 1,4,13 weeks).

Here is my calc:

count of items classified as On Time/count of total population during reporting period)*100

My thought process was the following:   (which is giving me an error). !

sum(Count([Rct_Date]-[Del_Date]<=0)) / (sum(total(Count(Rct_date))))

Then qualify by the time period I need and use each measure based on it's time period in the appropriate gauge chart.

Any help would be greatly appreciated!

1 Solution

Accepted Solutions
MVP

Try

Count(If( [Rct_Date]-[Del_Date]<=0,1)) /  Count( Total  Rct_Date])

Does this work?

6 Replies
MVP

Try

Count(If( [Rct_Date]-[Del_Date]<=0,1)) /  Count( Total  Rct_Date])

Does this work?

Anonymous
Not applicable
Author

Thank you!  That does help with the first part of my question.  Now I just need to find out how limit to the correct time periods!

MVP

And how  do you calculate these time periods or in what fields are these time periods based upon?

Anonymous
Not applicable
Author

So, here's my next thought (for gauge #1 - 13 weeks)...I'm versed in sql, so my thoughts go to dateadd.  I could be totally off here as to a formula in Qlik....:

If(Rct_date>=(today()-13Week),

Count(If( [Rct_Date]-[ERF_END_Date]<=0,1)) /  Count( Total  Rct_Date])*100

,1)

I know the expression is not quite right, as I have an error, but can anyone direct me?

Again, what I am trying to accomplish is?

• create a measure for 3 gauge chart showing me % on time deliveries.
• A gauge chart for each time period of 1,4,13 weeks).

Here is my needed calc:

count of items classified as On Time/count of total population during reporting period)*100

MVP

In general, use aggregation functions in expressions:

Use Aggregation Functions!

Try

Count(If( [Rct_Date]-[ERF_END_Date]<=0 and [Rct_Date]>=Today()-13*7 ,1)) /  Count( Total  If([Rct_Date]>=Today()-13*7,Rct_Date]))*100

Anonymous
Not applicable
Author

Thanks for the direction!!