Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Calculate the number of days in which sales were

Who can help me

7 Replies
JonnyPoole
Employee
Employee

Hi - i found this question in your QVW

"Hi all!. Need help. How i can count date in month there was sales.  Thanks"

I used this expression to count the dates (days) where Sales > 0

count( distinct  if( Sales > 0 , Fact_data))

You don't have a lot of data to test... the last column in the screenshot is the same formula as above.  Hopefully it works for you ?

Capture.PNG.png

Not applicable
Author

OK. Good. But i have question. How am can use set in this formula.

I need take in this formula sum(<{Family = {"Иванов"}>}SALES), but this is empty value

What do you mind above this formula

=Sum(Aggr(If(sum({<Family={"Иванов"}>}Sales) , 1, 0), Fact_data))

But this formula don't return all information for all family

JonnyPoole
Employee
Employee

HI - was is the business question you are trying to answer with your latest post ? 

-Do you still want to count the number of dates in a month that there were sales?

-Or do you want to count the # sales there were for each family ?

-Or do you want to combine the 2 and answer the # of sales there were in each month for just 1 family ?

When you use SET ANALYSIS with a family hard coded, it will only calculate the results for the family ...not for others.

Not applicable
Author

I have situation when i show column with data on days and see what is count = who, but when a make aggregation for a month a see that 3. How it s impossible.

Answer Yes -Or do you want to count the # sales there were for each family ?

JonnyPoole
Employee
Employee

I did not get  a clear idea of the  table that you need and did not understand your response. My suggestion is to create a table in excel that illustrates what the table SHOULD look like. 

However, If you want to see the # of days that had sales by family here are a few options:

Capture.PNG.png !

Not applicable
Author

This formula on my date set is incorrect. I see cell where null value, but this day is calculated.

That do you thing above formula Count(aggr(NODISTINCT IF($(=Sales)>0,$(=Sales)),Fact_data))

They also incorrect.

JonnyPoole
Employee
Employee

Hi - i am actually not clear on your requirement.  If you can upload your QVW as well as a picture of what you need the result to look like that would help very much.