Announcements
Discover what’s possible with embedded analytics! March 6, 10 AM ET SIGN UP!
cancel
Showing results for
Did you mean:
Partner - Contributor III

## where autonumber = odd number / even number

I have splited one column to two (A.B) if they have the same value in C by doing this:

Join:

AutoNumber(D,C)as Autonumber

....

Table1

C
Resident Join
Where Autonumber=1;

Join Table1
C
Resident Join
Where Autonumber=2;

This works for most of the cases, but I have cases where for the same value in C, there are more than two values in D, so D will be 1,2,3,4,5,6,......

I want A to be D value of all odd numbers (where Autonumber = odd number); B to be the D value of all even numbers.

How can I realise this?

Thanks,Luda

2 Replies
MVP

Maybe using Odd() and Even() functions?

https://help.qlik.com/en-US/qlikview/12.1/Subsystems/Client/Content/ChartFunctions/GeneralNumericFun...

C
Resident Join
Where  Odd(Autonumber);

Join Table1
C
Resident Join
Where Even(Autonumber);

MVP

Hi,

one solution might be also

```Table1:
Generic
Pick(Mod(AutoNumber(D,C)-1,2)+1, 'A', 'B'),
D
Inline [
D, C
D11, C1
D21, C2
D22, C2
D31, C3
D32, C3
D33, C3
D41, C4
D42, C4
D43, C4
D44, C4
];
```

hope this helps

regards

Marco

Community Browser