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: 
AH
Creator III
Creator III

Tricky Gross amount calculation

Hi,

I have a scenario like this, I have to calculate the Gross Amount summing up the SalesRegister, Service and FreeText amount. The problem here is, I have to exclude couple of GL account from FreeText while summing up. And this GL account shouldnt be excluded from SalesRegister and Service while summing up.

My Expression is like this:
=num(Sum({<SalesType = {'SalesRegister', 'FreeText', 'Service'}>}TotalLineAmountInReportCurrency),'##,##0')

Accounts to be excluded from Freetext only is: 100, 101, 115, 120, 430 and 420


Its sounds little tricky to me to calculate this.

Any Suggestions? Please


Thanks,
Shan

11 Replies
anbu1984
Master III
Master III

=num(Sum({<SalesType = {'SalesRegister',  'Service'}>}TotalLineAmountInReportCurrency) +

Sum({<SalesType = { 'FreeText'},GlAcct-={100, 101, 115, 120, 430, 420}>}TotalLineAmountInReportCurrency)

,'##,##0')

agomes1971
Specialist II
Specialist II

Hi,

=num(Sum({<SalesType = {'SalesRegister', 'FreeText', 'Service'}>}TotalLineAmountInReportCurrency),'##,##0')-

num(Sum({$<Accounts={100,101,115,120,'430 and 420'},SalesType={'FreeText'}>}TotalLineAmountInReportCurrency),'##,##0')


maybe?


Regards


André Gomes

AH
Creator III
Creator III
Author

Hi Anbu,

The expression looks ok but its showing red marks and the field TotalLineAmountInReportCurrency is not showing right. Could you please have a look at the attachment?

Capture.PNG

Thanks,

Shan

agomes1971
Specialist II
Specialist II

Hi,

the GLAccount is a string ?

Regards

André Gomes

AH
Creator III
Creator III
Author

Yes thats a String.

Thanks,

Shan

agomes1971
Specialist II
Specialist II

Glad to help.

André Gomes

AH
Creator III
Creator III
Author

Hi Andre,

Thanks for your reply. Can you explain Why this two giving slightly different numbers?


{$<Accounts={100,101,115,120,'430 and 420'}

{$<Accounts={100,101,115,120,430,420}

Thanks,

Shan

agomes1971
Specialist II
Specialist II

Yes because these are different type of selections... but you should use {$<Accounts={100,101,115,120,430,420}. The , it's like an OR...

Regards

André Gomes

AH
Creator III
Creator III
Author

So In my case you suggest this one

{$<Accounts={100,101,115,120,430,420}

Than this one?

{$<Accounts={100,101,115,120,'430 and 420'}

Thanks,

Shan