Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Count of products per week?

Hi,

I have to create how many Products there are per week.

I used

Dimension: Week

Expression: Count(Distinct(Productname))

will this get correct values? can anyone suggest me please.

Thanks.

15 Replies
martinpohl
Partner - Master
Partner - Master

within count (distinct Productname) you will get the numbers of different Productnames per week.

If you want to get the numbers of products you need to sum the numbers like sum(parts)

Not applicable
Author

Thanks. when I use

Dimension: Week

Expression: Sum(Productname)

it is showing 'no data to display'.

Edit: I changed my expression as Count({<WeekDay=, [WeekDay]=, Productname=,[Productname]=>}[Productname])

but after using this it is showing incorrect values.

Could you please elobarate what you mean. if the expression is wrong which I mentioned in Edit . Please can you change this.

jonathandienst
Partner - Champion III
Partner - Champion III

Hi

Sum(Productname)  - this looks like you are trying sum non-numerical data, so I would expect the message you are seeing. You can Count() but not Sum()


HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
martinpohl
Partner - Master
Partner - Master

no, not sum(Productname). You can't add figures, only values.

Is there a field that contains the number of product you have sold or sell or produced?

Not applicable
Author

Sorry I changed my expression which I mentioned in my post as Edit.

I don't have any sold or sell or produced.

Actually I have Productnames add to database table every day. so, I need to calculate how man products are there per week. Is it possible?

Edit:  Count({<WeekDay=, [WeekDay]=, Productname=,[Productname]=>}[Productname])

Not applicable
Author

Any solution Please?

SunilChauhan
Champion
Champion

Count({<WeekDay=, [WeekDay]=, Productname=,[Productname]=>}[Productname])


Chart will not change on selection of  WeekDay, [WeekDay], Productname,[Productname]

but it will dynamically update your count of product if any new product is added to db.


i thing no need to remove selection like above

you can simply use CounT( distinct ProductName) and week as dimenstion that will work Great.



Hope this make sense

Sunil



Sunil Chauhan
Not applicable
Author

Thanks. I used Count(Distinct Productname) in bar chart. can I use the same dimension and expression to get the values for Productname split per week?

SunilChauhan
Champion
Champion

ya sure

Sunil Chauhan