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: 
mahitham
Creator II
Creator II

Feild creation issue

Hi Experts,

Can any one please help me on below issue.

I am trying to create a Status field  with ABID and ABID SG records based on below condition

if [ Product Level 1] is 'ABID', 'ABID3' then its 'ABID'

if [ Product Level  1] is 'ABID'+ [Product Level 3] is 'Sales Control' then its ABID SG


I have created this field like below.


if(Match([ Product Level 1], 'ABID', 'ABID3'),'ABID',

if(Match([ Product Level 1], 'ABID') and Match([Product Level 3],'Sales Control'), ' ABID SG'))  as Status

When I have applied only first condition i.e.,  if(Match([ Product Level 1], 'ABID', 'ABID3'),'ABID' then in the table I am able to see

only ABID,ABID3 under Product Level 1 and Product Level 3 is the subset of Product Level 1 it contains 'Sales Control' which is correct.


[ Product Level 1]    [Product Level 3]      Status

ABID                        Sales Control             ABID

ABID                        Product Control         ABID

ABID3                      ajklfkdsf                     ABID

ABID3                      ebkklfsdsf                  ABID


But when I have run the above two conditions at a time getting below result i.e.,


Actual output by above expression:

[ Product Level 1]    [Product Level 3]      Status

ABID                        Sales Control             ABIDSG

ABID                        Product Control         ABID

ABID3                      ajklfkdsf                     ABID

ABID3                      ebkklfsdsf                  ABID


Expected output:

[ Product Level 1]    [Product Level 3]      Status

ABID                        Sales Control             ABIDSG

ABID                        Sales Control             ABID

ABID                        Product Control         ABID

ABID3                      ajklfkdsf                     ABID

ABID3                      ebkklfsdsf                  ABID



Please let me know am I missed any thing in the above expression syntax. Please help me on this.


Thanks in advance.

4 Replies
mahitham
Creator II
Creator II
Author

Hi stalwar1,

Could you please suggest some thing for the above issue.

agigliotti
Partner - Champion
Partner - Champion

maybe you have to invert the if conditon as below:

if( Match([ Product Level 1], 'ABID') > 0 and Match([Product Level 3],'Sales Control') > 0, ' ABID SG',

if( Match([ Product Level 1], 'ABID', 'ABID3') > 0, 'ABID') )  as Status;

mahitham
Creator II
Creator II
Author

Hi Andrea,

Thanks for your reply. But still not working.

After reload the script with above condition, when I have filtered Status - ABID

getting

[ Product Level 1]  - ABID

[Product Level 3] - Sales Control is in grey mode  its not coming under ABID status.

Here one condition is over riding other.

Expected output:

[ Product Level 1]    [Product Level 3]      Status

ABID                        Sales Control             ABIDSG

ABID                        Sales Control             ABID

ABID                        Product Control         ABID

ABID3                      ajklfkdsf                     ABID

ABID3                      ebkklfsdsf                  ABID

agigliotti
Partner - Champion
Partner - Champion

with the condition i wrote above, you should get as below:

[ Product Level 1]    [Product Level 3]      Status

ABID                        Sales Control             ABIDSG

ABID                        Sales Control             ABIDSG

ABID                        Product Control         ABID

ABID3                      ajklfkdsf                     ABID

ABID3                      ebkklfsdsf                  ABID


and if you select Status = ABID you should get only the last three rows.