Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Possible Multiple If condition

Hi,

I need help.  I have transaction data that are in group Tender Board A, Tenders Board B, Tenders Board C. In which have approving authority (name 1 ,name 2,name 3)     

transaction NumberTenderName 1Name 2Name 3
0000000001Tender Board ARoyCharanjitPenn
0000000002Tenders Board BPennMunLing
0000000003Tenders Board BPennMunCharanjit
0000000004Tenders Board BPennMunLing
0000000005Tender Board CPaulCharanjitMun
0000000006Tender Board CPaulStephAnnie
0000000007Tender Board CLingStephAnnie
0000000008Tender Board ARoyMunCharanjit

In my qlikview, I have an image(text box) which will appear if conditions is made.

The CONDITIONS are:

User Selected transaction number,

    If is group "Tenders Board C", Annie and Steph IS NOT in the 3 names, the image will appear,

    If is group "Tenders Board B", Ling IS NOT in the 3 names, the image will appear,

    If is group "Tender Board A", Ling IS NOT in the 3 names, the image will appear,

RESTRICTIONS:

The expression should be in the text box and not the script as originally the name are generated after running the script.

Attach are the data, same as the table above.

I am unable to view .qvw due to personal edition. A screenshot is kindly appreciated

1 Solution

Accepted Solutions
MK_QSL
MVP
MVP

Use below conditions for

A

=

IF(GetSelectedCount(Tender) = 0 and GetSelectedCount([transaction Number])=0, 0,

IF(SubStringCount(Concat(DISTINCT Tender,','),'Tender Board A')=0,0,

IF(SubStringCount('|'&Upper(Concat({<Tender = {'Tender Board A'}>}DISTINCT Name, '|')&'|'),'|LING|')=0,0,1)))

B

=

IF(GetSelectedCount(Tender) = 0 and GetSelectedCount([transaction Number])=0, 0,

IF(SubStringCount(Concat(DISTINCT Tender,','),'Tenders Board B') = 0, 0,

IF(SubStringCount('|'&Upper(Concat({<Tender = {'Tenders Board B'}>}DISTINCT Name, '|')&'|'),'|LING|'),1,0)))

C

=IF(GetSelectedCount(Tender) = 0 and GetSelectedCount([transaction Number])=0, 0,

IF(SubStringCount(Concat(DISTINCT Tender,','),'Tender Board C') = 0, 0,

IF(SubStringCount('|'&Upper(Concat({<Tender = {'Tender Board C'}>}DISTINCT Name, '|')&'|'),'|ANNIE|') and SubStringCount('|'&Upper(Concat({<Tender = {'Tender Board C'}>}DISTINCT Name, '|')&'|'),'|STEPH|'),1,0)))

View solution in original post

23 Replies
sunny_talwar

What do you mean if is Group? Do you mean that the user will make a selection in particular group before the image will be viewed?

Anonymous
Not applicable
Author

Hi, thanks for the quick reply.

The user will select the transaction number. In fact, my original have a search box will user will enter the transaction number. Once the transaction number is selected (searched), the image will be viewed based on the conditions.

hemanthaanichet
Creator III
Creator III

Hi Jia,

Could you elaborate the conditions once again

i have a  doubts in that let me what is that not in the 3 names in your conditions

if u can provide what is your expected output that will be more helpful

Regards

Hemanth

MK_QSL
MVP
MVP

Like this?

Anonymous
Not applicable
Author

Hi, thks for the quick reply.

I am unable to view it due to personal edition. Are you able to screenshot the expression instead?

Thank you!

Anonymous
Not applicable
Author

Hi, thks for the quick reply as well,

for example,

when User selected transaction: 0000000005, the image will appear as Steph and Annie is not in the 3 names(Paul,Charanjit,Mun).

When User selected transaction:0000000006, the image will not appear as Steph and Annie is in the 3 names.

MK_QSL
MVP
MVP

I have used below script

CrossTable(NO, Name,2)

LOAD [transaction Number],

     Tender,

     [Name 1],

     [Name 2],

     [Name 3]

FROM

[Example tessting.xlsx]

(ooxml, embedded labels, table is Sheet1);

Now Create Three Text Boxes

Type below condition to layout tab of each text box... conditional show ...

For A

=IF(SubStringCount('|'&Upper(Concat({<Tender = {'Tender Board A'}>}DISTINCT Name, '|')&'|'),'|LING|'),0,1)

For B

=IF(SubStringCount('|'&Upper(Concat({<Tender = {'Tenders Board B'}>}DISTINCT Name, '|')&'|'),'|LING|'),1,0)

For C

=IF(SubStringCount('|'&Upper(Concat({<Tender = {'Tender Board C'}>}DISTINCT Name, '|')&'|'),'|ANNIE|') and SubStringCount('|'&Upper(Concat({<Tender = {'Tender Board C'}>}DISTINCT Name, '|')&'|'),'|STEPH|'),0,1)

Make sure to check the typo..

You have used

Tender Board A

Tenders Board B

Tender Board C

Anonymous
Not applicable
Author

Hey, can you please elaborate your condition little more.

Thanks,

Anonymous
Not applicable
Author

Hi, I tried. it's close.

When nothing is selected, box A and B did not disappear.

Example tessting01.JPG

When Transaction 1 is selected, box C should no appear as transaction is Tender Board A and not Tender Board C.

Example tessting02.JPG

Thks for the typo head up as well.