on 05-03-2018 6:55 AM
Have two columns:
Pno Dno Quan
311 45 1000
311 40 2000
641 45 3000
551 40 4000
I want to have only the combination of row 1,3 and 5 (sum of Quan is 8000) extracted in a Query, but I have Challenges on how to do this directly in the Query without making a CONCAT Field in the ADSO.
Any idea how I should do this?
Hello Helge;
I think you can do it using RFK but you will need variables for Pno and Dno.
1. RFK with Qty and exclude value of Pno variable (RKF1)
2. RFK with Qty and exclude value of Dno variable (RKF2)
3 CKF with formula: IF (RKF1 = RKF2; RKF1 (or RKF2); MAX (RKF1, RKF2)
The result should be something like this:
Pno Dno Quan RKF1 <> 311 RKF2 <> 40 CKF
311 45 1000 0 1000 1000
311 40 2000 0 2000 0
641 45 3000 3000 3000 3000
551 40 4000 4000 0 4000
Of course, remove Pno or Dno from the structure or multiple combinations to exclude will not work.
Hope it helps;
Regards
Ricardo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
if Dno always should represent the highest value, this is what you can do
create a formula -> create a formula variable in it, set as replacement path of Dno -> add condition to the query, set as top 1 of the formula and assign only Dno as reference.
Now only the line:
311 45 1000
should remaingrtz
Koen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
89 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.