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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
ajsjoshua
Specialist
Specialist

count and if in set analysis

Hi all,

i am using the formula

=count(DISTINCT if(sum({<Year={$(=Max(Year))},MonthID={$(=Max(MonthID))},TransactionType={'INVOICE'},Year=,Month,Quarter=>}#InvNetSales) 

-  sum({<Year={$(=Max(Year))},MonthID={$(=Max(MonthID))},TransactionType={'CreditNote'},Year=,Month,Quarter=>}#InvNetSales))<0,Item)

i want to count the item whose invoice netsales - credit netsales value is lesser than zero.

1 Solution

Accepted Solutions
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Try something like Count({<Item={"=sum(..invoice..)-sum(..credit note..)<0"}>}Item). If you need more help please post a small qlikview document that illustrates the problem


talk is cheap, supply exceeds demand

View solution in original post

3 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Try something like Count({<Item={"=sum(..invoice..)-sum(..credit note..)<0"}>}Item). If you need more help please post a small qlikview document that illustrates the problem


talk is cheap, supply exceeds demand
HirisH_V7
Master
Master

Hi,

May be like this,

=if(sum({<Year={$(=Max(Year))},MonthID={$(=Max(MonthID))},TransactionType={'INVOICE'},Year=,Month,Quarter=>}#InvNetSales)

-

sum({<Year={$(=Max(Year))},MonthID={$(=Max(MonthID))},TransactionType={'CreditNote'},Year=,Month,Quarter=>}#InvNetSales)<0,

Count(Distinct Item) )

HTH,

Hirish

HirisH
HirisH_V7
Master
Master

Hi,

Check this attached,

Data:

LOAD * INLINE [

    ITEM, Sales 1, Sales 2

    1, 100, 888

    2, 111, 22

    3, 21, 11

    4, 111, 1111

];

Front end:

Conditional Count-205506.PNG

HTH,

PFA,

Hirish

HirisH