Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

paulyeo11
Valued Contributor II

Expression work for 1 variable but not work for 2 variable

Hi All

I have create a variable = Days

and i insert the above variable to below expression , it work fine :-

If(Sum({<SEGMENT -= {'Related Coy'},aging_ar = {'>=$(=vDay)'} >}total_ar  * 1) > 0,


Sum({<SEGMENT -= {'Related Coy'},aging_ar = {'>=$(=vDay)'} >}total_ar  * 1))


Due to i need to add one more variable , so i create one more variable = Days1


and again i insert to my expression , but it cannot work.

If(Sum({<SEGMENT -= {'Related Coy'},aging_ar = {'>=$(=vDay)''<=$(=vDay1')} >}total_ar  * 1) > 0,


Sum({<SEGMENT -= {'Related Coy'},aging_ar = {'>=$(=vDay)''<=$(=vDay1)'} >}total_ar  * 1))


Hope some one can share with me where i go wrong ?


Paul


1 Solution

Accepted Solutions

Re: Expression work for 1 variable but not work for 2 variable

My Bad, You should've change into If level as well

If(Sum({<SEGMENT -= {'Related Coy'},aging_ar = {">=$(=vDay) <=$(=vDay)"} >}total_ar  * 1) > 0,

Sum({<SEGMENT -= {'Related Coy'},aging_ar = {">=$(=vDay) <=$(=vDay1)"} >}total_ar  * 1))

OR

If(Sum({<SEGMENT -= {'Related Coy'},aging_ar = {">=$(vDay) <=$(vDay1)"} >}total_ar  * 1) > 0,

Sum({<SEGMENT -= {'Related Coy'},aging_ar = {">=$(vDay) <=$(vDay1)"} >}total_ar  * 1))

12 Replies
devarasu07
Honored Contributor II

Re: Expression work for 1 variable but not work for 2 variable

Hi,

Can you try like below,

Sum({$<SEGMENT -= {'Related Coy'},total_ar={">0"},aging_ar = {'>=$(=$(vDay))<=$(=$(vDay1))'} >}total_ar  * 1)

or try this way

Sum({$<SEGMENT-= {'Related Coy'},total_ar={">0"},aging_ar = {'>=$(vDay)<=$(vDay1)'} >}total_ar  * 1)


Thanks,

Deva

Re: Expression work for 1 variable but not work for 2 variable

I already explain, To each From and To buckets you need Double Quotes "" not single one as Set analysis is good for setting. Let's try now

If(Sum({<SEGMENT -= {'Related Coy'},aging_ar = {'>=$(=vDay)''<=$(=vDay1')} >}total_ar  * 1) > 0,

Sum({<SEGMENT -= {'Related Coy'},aging_ar = {">=$(=vDay) <=$(=vDay1)"} >}total_ar  * 1))

OR

If(Sum({<SEGMENT -= {'Related Coy'},aging_ar = {'>=$(vDay)''<=$(vDay1')} >}total_ar  * 1) > 0,

Sum({<SEGMENT -= {'Related Coy'},aging_ar = {">=$(vDay) <=$(vDay1)"} >}total_ar  * 1))

paulyeo11
Valued Contributor II

Re: Expression work for 1 variable but not work for 2 variable

Hi Deva

Thank you very much it work fine.

Paul Yeo

paulyeo11
Valued Contributor II

Re: Expression work for 1 variable but not work for 2 variable

Hi Anil

I have test your expression , it does not work. Since Deva expression is working fine. i am using it. Thank you for your help.

Paul

Re: Expression work for 1 variable but not work for 2 variable

My Bad, You should've change into If level as well

If(Sum({<SEGMENT -= {'Related Coy'},aging_ar = {">=$(=vDay) <=$(=vDay)"} >}total_ar  * 1) > 0,

Sum({<SEGMENT -= {'Related Coy'},aging_ar = {">=$(=vDay) <=$(=vDay1)"} >}total_ar  * 1))

OR

If(Sum({<SEGMENT -= {'Related Coy'},aging_ar = {">=$(vDay) <=$(vDay1)"} >}total_ar  * 1) > 0,

Sum({<SEGMENT -= {'Related Coy'},aging_ar = {">=$(vDay) <=$(vDay1)"} >}total_ar  * 1))

paulyeo11
Valued Contributor II

Re: Expression work for 1 variable but not work for 2 variable

Hi Anil


Now your expression is working fine. and display the correct amount .


Deva table 1A display 11,766 is correct.

Anil Table 1B display 11,616 is wrong. ( As your expression does not filter Comms Technology Pte LTd amount 150 )


Not sure why ?


Paul

Re: Expression work for 1 variable but not work for 2 variable

Hi Anil

Now your expression is working fine. and display the correct amount .

Anil Table 1B display 11,616 is wrong

paulyeo11
Valued Contributor II

Re: Expression work for 1 variable but not work for 2 variable

Hi Anil

My typing mistake , Table 1B is correct.

Paul

Re: Expression work for 1 variable but not work for 2 variable

Quotes in Set Analysis May be helps

Community Browser