cancel
Showing results for 
Search instead for 
Did you mean: 

compare two characteristics in Query

Former Member
0 Kudos

Hi Experts,

I have to compare two characteristics in Query fields like (A)Approved Level of Job(contain values like 01,02,03,04) and (B)Required Level of Job(contain values like 01,02,03,04).

Now I have to do these calculations

If A>B =1

If A<B =0

And also in other case

If A=b then value 1

Of A =/= B then value 0

Please let me know how I can achieve this.

These values could be in A,B,C,D instead of 01,02,03,04 then in that case how I will calculate these comparison.

Thanks

Take care

Vishal sharma

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Vishal,

You can achieve your desire output by following below steps.

1) Create 2 replacement formula variable, VAR1 for approval level and VAR2 for required level. with properties number.

2) now create formula(CKF) in your query, use these two variable.

use following formula.

VAR1>VAR2.

if this will satisfy then it gives output 1, and if not then it will give you output 0.

But for follow above steps you have to put both the characteristics in drill down. its prerequisites for this solution. Please let me know if you have any concern.

Thanks & Regards,

Ashish

Former Member
0 Kudos

First of all, the following logic only works on numerics. If you are using characters then a greater than / less than comparison is not possible. If the values come through as characters then your easiest solution will be to create your logic in the InfoProvider.

Let's assume you are using the numeric solution, you need to convert Approved Level of Job and Required Level of Job to key figures. You can do this by creating new calculated key figures called Approved Level of Job and Required Level of Job. Then you need to use formula variables in the CKF definitions. The formula variable should be a replacement path based on Approved Level of Job and Required Level of Job.

Now you have two key figures with which you can create the IF statements, which would look similar to this:

(A >= B) * 1

I don't understand what you mean by "Of A =/= B then value 0".

Former Member
0 Kudos

Hi,

i need the solution in this format on the comparison two characteristics in Query:

0=false

1=true

Approved Level of Job(A) Required Level of Job(B) A=B A not equal B A>B A<B

1 3 0 1 0 1

4 2 0 1 1 0

3 3 1 0 1 1

5 4 0 1 1 0

1 2 1 1 0 1

count(A):5 Count(B)5 sum 2 sum 4 sum 3 sum 3

so my CKF will be

A>B/5 means 3/5=60%

I also need to know how i am going to count A and B too.

thanks

take care

vishal sharma

Former Member
0 Kudos

Hi,

i need the solution in this format on the comparison two characteristics in Query:

value in Approved Level of Job(A) = 3

value in Required Level of Job(B) =4

So comparisons values will be like

0=false

1=true

A=B----


0

A not equal B -


1

A>B----


0

A<B----


1

thanks

take care

vishal sharma

Former Member
0 Kudos

Hi McGonnell,

are your sure that it is going to work in this way for numeric values in char.

thanks

take care

vishal sharma