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

dates duplicating data

Hey guys!

I have a problem with stock numbers anda different dates

Table 0

PRODUCT

Table 1

PRODUCT - COMPANY - STOCK

Table 2

PRODUCT - COMPANY - DATE - SALES


The problem is that in one pivot table i want to show all products and current stock, but when i do, everything duplicates because of sales dates


How can i "ignore" the dates?


Thanks!

3 Replies
effinty2112
Master
Master

Hi Victor,

Does Table1 have one line per product? Maybe a flaw in your script has caused replications of lines in your data model. If there is only one line per product in this table then a straight table with dimension PRODUCT should work.

If Table 1 has stock qtys at a certain date or time do you want a calculated stock based on these figures minus sales since date of stock check? If so we may need to consider goods coming into stock since the stock was counted.

Regards

Andrew

Not applicable
Author

Hey Andrew

using real name for table

product_table
store_table
stock_table (with only product, store, stock) (no date, only the current stock)
sales table (with product, store, date, sale)

if i load only one day, it has the number i need, if i load more days, it duplicate


and if i filter dates, it will filter products, and i dont want that

I need to go to the report without selecting dates, and have a number with no duplicationg because of the dates

effinty2112
Master
Master

Hi Victor,

Is the problem you're having to do with showing sales by date and stock in a single straight table?

if you make a straight table like:

  

ProductStoreDateSum(Sale)
ARenton01/05/201745
AAlexandria01/05/201712
ARenton30/04/201736
AAlexandria01/05/201725
ARenton02/05/201715

then add an expression Sum(Stock) you'll get something like

    

ProductStoreDateSum(Sale)Sum(Stock)
ARenton01/05/201745100
AAlexandria01/05/20171260
ARenton30/04/201736100
AAlexandria01/05/20172560
ARenton02/05/201715

100

Because of your data model values of Stock will be associated to more than one date value if the product is sold on multiple dates.

Is this the problem?

Cheers

Andrew