Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
Vijesh
Contributor
Contributor

SUM Function to show Taxable and Non Taxable amount.

Hello Friends,

I was practicing SUM function in QilkView.  as I am a beginner I got failed. please help me out.

please go through the attachment. I have mentioned what output I want.

 

Thanks,

1 Solution

Accepted Solutions
Gabriel
Partner - Specialist III
Partner - Specialist III

Hi,

 

Try below and see attached

//script

TMP:
LOAD *,
IF([Tax %] >0,1,0) AS [TaxFlag]
;
LOAD * INLINE [
Trx No., Description, Cost, Tax %, Tax Amount, Total
A001, Milk, 7.5, 5, 0.38,7.88
A001, Water, 2.95, 5, 0.15,3.1
A001, Egg, 25, 0, 0,25
];

//use straight table
//Dim = Trx No.

//Expr1 Label = Taxable Amount (Tax% = 5)
Expression = SUM({<TaxFlag = {1}>}Total)

// Expre2 Label = Non Taxable amount (Tax% = 0)
Expression = SUM({<TaxFlag = {0}>}Total)

//Expr3 Label = Tax
Expression = SUM({<TaxFlag = {1}>}[Tax Amount])

//Expr4 Label = Total
Expression = SUM(Total)

 

 

View solution in original post

2 Replies
Gabriel
Partner - Specialist III
Partner - Specialist III

Hi,

 

Try below and see attached

//script

TMP:
LOAD *,
IF([Tax %] >0,1,0) AS [TaxFlag]
;
LOAD * INLINE [
Trx No., Description, Cost, Tax %, Tax Amount, Total
A001, Milk, 7.5, 5, 0.38,7.88
A001, Water, 2.95, 5, 0.15,3.1
A001, Egg, 25, 0, 0,25
];

//use straight table
//Dim = Trx No.

//Expr1 Label = Taxable Amount (Tax% = 5)
Expression = SUM({<TaxFlag = {1}>}Total)

// Expre2 Label = Non Taxable amount (Tax% = 0)
Expression = SUM({<TaxFlag = {0}>}Total)

//Expr3 Label = Tax
Expression = SUM({<TaxFlag = {1}>}[Tax Amount])

//Expr4 Label = Total
Expression = SUM(Total)

 

 

Vijesh
Contributor
Contributor
Author

Thanks Friend. that's done.