Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Help with script for Dates comparison (year over Year)

Hi All I am coming up with a strange issue.  We have introduced a new discount program which gives 15% off on the goods the customer purchased and  the customers who qualify can take the discount as many times he can . The very first date the customer takes advantage of the program we are capturing in a table called Customer_Discount_Start_Date. And we have a Sales table in which we capture the sales for the entire sales from past 3 years until today. And i Have a calendar table in which we have created some flags for doing Year over Year, YTD, last 24 months etc for using this flags in expressions. Now the users have requested to have a comparison like lets say if a customer (35790) whose first discount date is Jan-13-2014 and they want the sales from that first date to today as one expression that needs to be compared to the same year last year. How can i do that. Any ideas or help would be greatly appreciated. I have many customers like that. But for easy purpose i am loading only 2 customers in the qvw file with the attached. 

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

i was able to get the answer. Chiru thanks a lot for your help man.

View solution in original post

12 Replies
Anonymous
Not applicable
Author

any help on this please

Anonymous
Not applicable
Author

any help on this please

Anonymous
Not applicable
Author

help please

Jason_Michaelides
Partner - Master II
Partner - Master II

Can you provide an example (in Excel maybe) of how the correct table should look?

Not applicable
Author

A few things I can suggest.

The flag to caputre the discount start date can be joined to the table Sales and create a separate calendar for that.

Then using set analysis you can play around with it to get the desired result.

I know its very generic but it might help you to get your gears going.

Thanks

AJ

Anonymous
Not applicable
Author

Thank you AJ will try that way. I have attached some more information please let me know if anything an be helpful for me.

Anonymous
Not applicable
Author

Hi Jason I have attached the QVW file with the selections made for customer number 37590 to get the original numbers and that is how the table should look like. And in the file i have data until Feb-24-2014 but it will have up to today's date. Also i have attached the excel sheet with customer number and dates . For this customer the start date is Jan-13-2014. Please let me know if i need to provide additional information.

chiru_thota
Specialist
Specialist

Hi Vinay ,

Can you check numbers and let me know.

Are those numbers coming as per your requirement ?

Vinay.jpg

Thanks,

Chiru

Anonymous
Not applicable
Author

Chiru it is close enough but it might be missing , Just now i have attached the required numbers. and Looks like this is a good start for me. Thanks a lot for your help on this.