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

'how many customers ordered product a on the same day and/or one day later as product b?'

Hello,

I have made only easy aggregations in QlikView so far. This problem is a big fish for me

I need the number of customers who ordered product A on the same day and/or one day later as product B.

Three Columns: Customer_ID, OrderDate, Product

I would really appreciate you help.

Best Regards. Liana

16 Replies
sinanozdemir
Specialist III
Specialist III

Can you provide sample data for your scenario?

Anil_Babu_Samineni

Count({<Product = {"A"}>}Customer_ID) OR Count({<Product = {"B"}>}Customer_ID)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Not applicable
Author

Hello Mr. Ozdemir,

this is the first time I have posted a question. I can`t find the way to upload the QVW Data

Making  some Mistakes.

Thanks Liana

Not applicable
Author

Hello Mr. Babu,

your syntax is helpful, but I also need to consider the OrderDate. Group by Costumer only when the OrderDate for Product A the same or one day later as for Product B is.

Thanks. Best Regards. Liana

vishsaggi
Champion III
Champion III

May be this?

IF(OrderDate = Today(), Count({< Product = {'A'}>} Customer_ID), Count({< Product = {'B'} >})

Anil_Babu_Samineni

Liana, Still confused what you are expecting,

If you got any help from this Thread please put flag Mark as Helpful

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Not applicable
Author

Hello Vishsaggi,

the OrderDate are all in the past. I think that is why OrderDate=Today() is not working.

Who can I upload the QVW Data?Thanks

antoniotiman
Master III
Master III

Hi Liana,

If I have understood correctly, like this

Not applicable
Author

Hello Mr. Babu

the data look like these.  I am still searching for the flags to mark these helpful answers

  

CustomerOrderNrOrderDateProductQuantity
875956945642559415.04.2016A2
905050915646052123.05.2016B3
905050915646086924.05.2016A2
915477325646405927.05.2016B3
915477325646467127.05.2016A2
915775465643555211.05.2016N2
915775465648896022.06.2016A2
925564675644781009.05.2016N3
945838365645607819.05.2016I3
945838365647340805.06.2016B3
945838365647416506.06.2016A2
967154705641550306.04.2016B3
967154705641918711.04.2016B3
967154705642087411.04.2016A2
968272295641801408.04.2016A2