thanks but that solution is not exactly what i am looking for.
i should of stated more clearly perhaps here is the logic
if statement 1. Create a Flag where Tillsvallkod = 4, or 6 , (the rest should be discluded i.e 3)
if statement 2. Artkod z should appear in the list however if Artkod z has not moved in the last year then it should be discluded.
if statement 3. Artkod = 'a' should be discluded totaltly.
these flags in essence should be 111 as i had in my example , however i dont want to confuse the user by flags laying out in the front end tablebox,.
ultimately bringing everything down to one flag will be better i assume?
It seems like you are interested in the records where all Flags are set to 1, not any of them.
So you need AND operator here.
if(#FL1 and #FL2 and #FL3,1,0) as #FLAll;
//if(isNull(Artkod, 'N', ArtKod) as Artkod
if (isnull(ArtKod), 'N',ArtKod) as ArtKod,
if(Tillsvallskod = 4 or Tillsvallskod =6, '1','0') as #FL2,
if (ArtKod <> 'z' or ArtKod = 'z' and SenRoresleDatum > today () - 365, 1,0) as #FL1,
if(ArtKod <> 'a' ,'1', '0') as #FL3,
(ooxml, embedded labels, table is Sheet1);