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

Help needed with an expression

Hi all,

I was wondering if anyone could help me with this expression.

I need to be able to calculate a percentage, view how many times over 12 months that percentage is above a certain target and then alert if the number of occurences is equal to or above 2 in the 12 month period.

For example; the target for a particular person is 5%, in January they acheived 6%, in February they acheived 4% and in March they acheived 6%. After the March figure please alert me to this person. I have several people I need to do this with but only want to highlight those which have gone above the target

I've been trying to rack my brains for a while now to try and figure how to to do this. I'm unable to upload an example to what I need due to protection of data am afraid, but if anyone could help me with this issue I would be very much appreciative.

6 Replies
nizamsha
Specialist II
Specialist II

I DONT KNW ABT ALERT BUT WE CAN MAKE REFERENCE LINE SUPPOSER IF UR TARGET IS 10 AND U REACHED 11 MEAN U CAN FIX THE TARGET IN 10

GO TO THE PERCENTATION TAB IN THAT ADD THE REFERENCE LINE

OR

IN THE EXPRESSION TAB GO TO THE EXPRESSION IN THAT CLICK THE BACKGROUND AND WRITE THE EXPRESSION

EG  IF(SUM(SALES)>100,GREEN(),RED())

TRY AND SEE

Not applicable
Author

Thank you for your reply

What I need is to count the number of months that the target was not met. So if the target was not met in January, met in February and not met in March, it needs to be flagged up.

In essence I need to see how many times a target was not met as long as this is above 2 times.

Thank you.

Not applicable
Author

Bnicholls,

is it possible to create a flag in your script if the target is met? Then you only need to use a count expression..

Not applicable
Author

Thank you for your reply,

I'm wondering how would you go about creating a flag in the script to highlight when a person has met their target, or failed to meet their target.

Thank you.

Not applicable
Author

Thank you for your reply,

I'm wondering how would you go about creating a flag in the script to highlight when a person has met their target, or failed to meet their target.

Thank you.

Not applicable
Author

I don't know the details about your situation but if you compute the percentage in your script and you have a static target you can create a flag as follows: IF(expression>A,1,0).

Considering the few details I know about your case I imagine you want to keep things more dynamic. Therefore I'd propose the following start:

Create a variable (through an input box) with the target.

Then use set analysis.

E.g. vTarget = .05

count({<PERCENTAGE ={">=$(vTarget}>} uniqueID)

You set the target manually, then the expression counts unique ID's for all your salespersons belonging to the set of sales persons that have met the target. Use for instance a pivot table to display your sales person dimension.

Meaning, you will get a count of how often each salesperson has met their target. Then use visual cues to highlight those that exceed your limit.

As regards the 12 month rule, use set analysis or a selection box, whatever fits your purposes best.

Hope this gives you a fair start, if not let me know.