Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
oskorn29
Contributor
Contributor

help with measurement generation

Good afternoon

I'm trying to generate a measure for a KPI

  For this I am using 3 fields

  1 Schedule

2 Window

3 Status

In the measure I need to count those elements that have the Pending Status and that the Window and Time difference is greater than 0 and less than 0.0313

Try to do it this way

Count ({$ <Status = {'PENDIENTE'}, [Window-Timetable] = {"> 0 <= 0.0313"}>} Status)

However, I am only managing to filter those that have Pending Status, I do not know if the problem is how I am defining the difference between Window and Schedule

  The 0.0313 I define it as time difference, for example [20: 00-19: 30]

6 Replies
captain89
Creator
Creator

Hi,

try using interval for the difference between two hours and do it in the script like this:

load*,

interval (Window-Timetable) as Difference.

Then you must check the differences using a table.

If the result is right you can do the  formula:

Count ({$ <Status = {'PENDIENTE'}, [Difference] = {"> 0 <= 0.0313"}>} Status)


I think you can't use set analysis if you don't pre-calculate the difference


Bye

lorenzoconforti
Specialist II
Specialist II

Maybe this?

=count(if(Status = 'PENDIENTE', if((Window-Timetable ) > 0,if((Window-Timetable )<= 0.0313,Status))))

balabhaskarqlik

Try this:

if((Window-Timetable ) > 0 and (Window-Timetable )<= 0.0313, Count ({$ <Status = {'PENDIENTE'}>} Status))

oskorn29
Contributor
Contributor
Author

Thank you very much for the reply

I have already managed to generate my KPI

Many thanks

captain89
Creator
Creator

Can you  mark the most useful suggestion, please?

Anonymous
Not applicable

Hi,

You should create a dimension [Window-Timetable] in the script, so that you can use it directly.