Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Subtotal - IF Function - SUM - AR Aging

Hi I have problem on expression syntax. New on using QBAR-QlikView.

if((Age >= 0) and (Age<= 30),OpenBalance*1,0)

Capture-AR-No Sum.PNGCan somebody help me with the code expression.

I think I miss SUM but i dont know the code.

Thanks in advance

Labels (1)
20 Replies
Anil_Babu_Samineni
MVP
MVP

May be this?

if((Age >= 0 and Age<= 30,OpenBalance*1,0)

or

Sum(Aggr(if((Age >= 0 and Age<= 30,OpenBalance*1,0), Type))

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Anonymous
Not applicable
Author

Hi Anil Thank you for your reply.

I dont know what's wrong on this sum. here is the snap

SUM IF.png

Kushal_Chawda
MVP
MVP

You need to include this condition inside aggregation function so that to aggregate your data with respect to your dimension

=sum(if((Age >= 0) and (Age<= 30),OpenBalance*1,0))

Kushal_Chawda
MVP
MVP

It's always better to write set analysis

=sum({<Age={">=0<=30"}>}OpenBalance*1)

Anonymous
Not applicable
Author

Capture3.PNG

Anil_Babu_Samineni
MVP
MVP

Try this?

Sum(Aggr(If(Age >= 0 and Age <= 30, OpenBalance * 1, 0), [Customer.Name]))

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Anonymous
Not applicable
Author

Capture2.PNG

Hi Kushal Bad field names:

Age & OpenBalance is a Expression Column

Capture4.PNG

mangalsk
Creator III
Creator III

try this

sum(aggr(sum({<Age={">=0<=30"}>}OpenBalance)*1+sum({<Age-={">=0<=30"}>}OpenBalance)*0,[Customer.Name]))

Anonymous
Not applicable
Author

Hi Sir Anil, The expression is OK. but the result comes "0"Capture-6.PNG.

Capture-7.PNG