Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
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

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

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
“Aspire to Inspire before we Expire!”
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
“Aspire to Inspire before we Expire!”