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

Extract data depending from two date in different table

Hello

I apologize for my week english.

I'm the following problem.

I've an application for retail analysis. I've two table one containg the single selling row (sold_table) with: product code, selling date, quantity (it' quite huge about 20 million records) ... a second table (products - 700 k records) contain product data: product code, brand and so on ... and the initial published date; the date when this product (books ad cd) was published.

I want to extract anc compare the "news" product .. for news it mean the product having a sale date in a range of 100 days of published date (that is different for each product).

I tried to calulate the flag in the load scritp with left join betwebut it seem to be to much for the memory adn I was unable to calculate dinamically in chart expression with set analysis or if expression

Thanks

Claudio

5 Replies
Not applicable
Author

Hi,

Can you share sample QV file?

It will be easy to understand and respond.

Happy Thoughts

Not applicable
Author

Here is

johnw
Champion III
Champion III

Here's one way. Replace your two expressions with these:

sum(if(selDate-pubDate<=100,quantity))

if(selDate-pubDate<=100,selDate-pubDate)

Edit: Added a flag solution and attached example. I don't THINK this way of establishing the flag will cause memory problems, though it will slow your script down. But I'd rather have a slow script than a slow chart, and using set analysis on a flag should execute much more quickly in the chart. So I recommend that approach instead of what I wrote above.

Not applicable
Author

Hi John

thanks for your response. I tested the sum(if(selDate-pubDate<=100,quantity)) formula befor post my question in forum ...but for some reason it did not work correctly in my "real" application (I thought tha could be an aggragation troub but it was probably a mine error)

I repeat that the left join soloution did noto work because of an out of memory error due (I think) to the houge data volume (about 1 millio books and 20 million sold records)

I solved wiht a mapping in the script with a set analysis statement in chart

Thanks

Claudio

Not applicable
Author

Ooops sorry I posted a wrong qvw in previous post.

This is the correcect one