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: 
Not applicable

Help me Please :)

Hello Guys,

Can you help me with this please

I have a list of products as shown below..

i need to detect the first time this product was sold & then draw a graph were the date is the dimension and the number of products sold for the first time is presented.

i mean to have a graph identfying that :

on Sunday : 6 products were sold for the first time.

on monday : 4 products were sold for the first time.

on Tuesday : 1 product was sold for the first time.

on Wednesday: 4 products were sold for the first time.

on Thursday: 0

Untitled.png

Thanks a lot guys

2 Replies
swuehl
MVP
MVP

The solution probably depends a bit on your data model, but you could try creating a chart with dimension Date and then as expression something like

=sum(aggr( if( Date = FirstSortedValue(total<Product> Date,Date),1,0), Product,Date))

Hope this helps,

Stefan

jagan
Luminary Alumni
Luminary Alumni

hi,

You can do this easily in your Script.  Usually I handle this in script by adding a additional flag.  By using this flag I calculate the New Products count.

Example:

Products:

LOAD

     ProductID,

     OrderID,

     Amount,

     If(Previous(ProductID) <> ProductID, 1, 0) AS IsNewProductSold

FROM DataSource

ORDER BY Customer, OrderID;

Now, just using Sum(IsNewProductSold) you can get the NewProducts count.

Regards,

Jagan.