Qlik Community

QlikView Integration

Discussion Board for collaboration on QlikView Integration.

Not applicable

Textbox If statement / Show condition / set variable not working

The error shown in the window as follows:

Garbage after Expression ','

1  | if(vSC_DateType = 'POSTING',
2  |
if(GetSelectedCount(Posting_DayOfMonth) <> 0,vPostSelectedDay=1 and
3  |
if(GetSelectedCount(Posting_Month) <> 0, vPostSelectedMonth=1 and
4  |
if(GetSelectedCount(Posting_CalendarYear) <> 0, vPostSelectedYear=1))
5  | ),
6  |
if(vSC_DateType = 'INSERT',
7  |
if(GetSelectedCount(Insert_DayOfMonth) <> 0, vInsertSelectedDay=1) or
8  |
if(GetSelectedCount(Insert_Month) <> 0, vInsertSelectedMonth=1)  or
9  |
if(GetSelectedCount(Insert_CalendarYear) <> 0, vInsertSelectedYear=1))
10 | ),
11 | if(vSC_DateType = 'CREATE',
12 | if(GetSelectedCount(Create_DayOfMonth) <> 0, vCreateSelectedDay=1) or
13 | if(GetSelectedCount(Create_Month) <> 0, vCreateSelectedMonth=1)  or
14 | if(GetSelectedCount(Create_CalendarYear) <> 0, vCreateSelectedYear=1))
15 |
)


Error seems like its starting at line 10. The first two if statements work, adding the third doesn't compile.

Any ideas?

Tags (1)
8 Replies
oknotsen
Honored Contributor III

Re: Textbox If statement / Show condition / set variable not working

Seems to me you do not have the right amount of brackets in there.

If you put your cursor in front of a bracket, that bracket becomes orange and underlined and so does the related bracket. Check if the right brackets are related.

Based on a quick check I did, the last bracket is not related to the first bracket and the openings bracket seems to be related with line 10 (which makes the error "garbage after line 10" understandable.

May you live in interesting times!
Not applicable

Re: Textbox If statement / Show condition / set variable not working

Yes you are correct, that was it. The other side effect of the logic is the variables never get set in the process

jyothish8807
Honored Contributor II

Re: Textbox If statement / Show condition / set variable not working

Hi Walter,

Try adding one more closing  bracket   " ) " at line 10 and two at line 15.

Regards

KC

Best Regards,
KC
balrajahlawat
Esteemed Contributor

Re: Textbox If statement / Show condition / set variable not working

Could you share a sample app?

oknotsen
Honored Contributor III

Re: Textbox If statement / Show condition / set variable not working

If your question is answered, could you please flag the Correct Answer (and optionally a Helpful Answer)?

If not, please let us know what part of your question still needs answering .

May you live in interesting times!
Not applicable

Re: Textbox If statement / Show condition / set variable not working

This fixed the issue: Although the variables did not update.

if(vSC_DateType = 'POSTING',

   if(GetSelectedCount(Posting_DayOfMonth) <> 0,vPostSelectedDay=1 or

   if(GetSelectedCount(Posting_Month) <> 0, vPostSelectedMonth=1 or

   if(GetSelectedCount(Posting_CalendarYear) <> 0, vPostSelectedYear=1))

),

if(vSC_DateType = 'INSERT',

   if(GetSelectedCount(Insert_DayOfMonth) <> 0, vInsertSelectedDay=1) or

   if(GetSelectedCount(Insert_Month) <> 0, vInsertSelectedMonth=1)  or

   if(GetSelectedCount(Insert_CalendarYear) <> 0, vInsertSelectedYear=1

),

if(vSC_DateType = 'CREATE',

   if(GetSelectedCount(Create_DayOfMonth) <> 0, vCreateSelectedDay=1) or

   if(GetSelectedCount(Create_Month) <> 0, vCreateSelectedMonth=1)  or

   if(GetSelectedCount(Create_CalendarYear) <> 0, vCreateSelectedYear=1)

)))

Not applicable

Re: Textbox If statement / Show condition / set variable not working

I got it thanks for your reply

dineshmdane
New Contributor III

Re: Textbox If statement / Show condition / set variable not working

Hi Walter,

I am also stuck with the same problem as yours.

Could you please provide the steps to solve the problem.

Regards,

Dinesh M

Community Browser