Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
rachelpurple
Partner - Contributor III
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

Load D as A

C
Resident Join
Where Autonumber=1;

Join Table1
Load D as B
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
swuehl
MVP
MVP

Maybe using Odd() and Even() functions?

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

Load D as A

C
Resident Join
Where  Odd(Autonumber);

Join Table1
Load D as B
C
Resident Join
Where Even(Autonumber);

MarcoWedel

Hi,

one solution might be also

QlikCommunity_Thread_280812_Pic1.JPG

Table1:

Generic

LOAD C,

    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