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

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

A tricky problem that I am facing

I need to draw a graph with a date and 2 expressions.

The table structure is like this and the sample data is like this

YearMonthWeekDaySalesDate
2012-201311-11100011-Jul-12
2012-201311-1130011-Jul-12
2012-201311-1250012-Jul-12
2012-201311-1320013-Jul-12
2013-201411-11250016-Jul-13
2013-201411-11150016-Jul-13
2013-201411-12500017-Jul-13
2013-201411-13250018-Jul-13
My chart should look like this
DateThis YearLast Year
16-Jul-1340001300
17-Jul-135000500
18-Jul-132500200

Should get 4000 based on the 2 records for 16-Jul, and 1300 is derived based on the same month, week and day in the previous year 2012-2013. 11-Jul-12 is the equivalent day in the previous year and the sum 1300 hence. and so on.

I tried something like this for the second expression but it just gives me the same value as the 1st expression.

=Sum( {<[Sale_year]={"=SubField([Sale_year], '-')-1  & '-' & SubField([Sale_year], '-')"} >} [Sales])

Can you kindly advise. The crux of this is the year in the second expression points to the previous years but all the other columns should match. (Month, week and day).

Thanks,

Ram

14 Replies
tresesco
MVP
MVP

Sorry, i did not get the issue.

Not applicable
Author

I posted the message before you added the text function around Subfield. Everything working perfectly now. Thanks a ton Treseco.

Not applicable
Author

Hi Treseco, Sorry to trouble you again. I am facing one more challenge. Now I want to display the date from the current year and not the date from the last year, though I wan to display the figures from the previous year.

If you look at the righmost chart in the attached file the chart displays 03/07/2013 and 10/07/2013 as the dates from the current year.

The chart now displays 4 rows where I expect to see only 2 rows as follows. i.e. I need to display the dates only from the current year.

DateF          Year          Month     Week     Day     Current            Previous

03/07/2013  2013-2014     1          1-1          1          720               220

10/07/2013  2013-2014   2        2-2        2        410                60

Thanks,

Ram

tresesco
MVP
MVP

Hi,

Please create a new thread to get more attention.

Not applicable
Author

Sure. Done.