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

Count units that were installed in scheduled month

Hi all. Just beginning to learn Qlikview. I'm hung up on developing a chart that displays percent of units (serial number) installed within 3 days of the scheduled date.

the data...

Serial NumberInstall DateScheduled InstallDays +/- Scheduled
1234510/5/201210/5/20120
2345610/5/201210/9/20124
3456710/1/201210/2/20121
4567810/1/201210/5/20124

...so the metric would be 50% (2/4)

my expression of the count of # Installed in month is working...

=Count(SERIAL_NUMBER)

my expression to get the count of # installed within 3 days of scheduled date is not working...

if (DAY_ACT_EC.FULL_DATE-DAY_ECSCHED.FULL_DATE < 4, count(SERIAL_NUMBER), 0)

Is this the correct approach to this or am I completely off in my method?

Thanks for the help

Mike

1 Solution

Accepted Solutions
fosuzuki
Partner - Specialist III
Partner - Specialist III

Your expression should be:

count(if (DAY_ACT_EC.FULL_DATE-DAY_ECSCHED.FULL_DATE < 4, SERIAL_NUMBER))

But you should avoid using if-statements in your expressions, since they can degrade the performance. Instead, try to use set analysis like this:

count({<DaysScheduled={"<4"}>} SERIAL_NUMBER)

to do so, you must precalculate the DaysScheduled in the script and have the values in a field.

View solution in original post

2 Replies
fosuzuki
Partner - Specialist III
Partner - Specialist III

Your expression should be:

count(if (DAY_ACT_EC.FULL_DATE-DAY_ECSCHED.FULL_DATE < 4, SERIAL_NUMBER))

But you should avoid using if-statements in your expressions, since they can degrade the performance. Instead, try to use set analysis like this:

count({<DaysScheduled={"<4"}>} SERIAL_NUMBER)

to do so, you must precalculate the DaysScheduled in the script and have the values in a field.

Not applicable
Author

That worked perfectly. Thank you very much.