Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
ziabobaz
Creator III
Creator III

comparing daily sales between years

Hi,

I am trying to put two dimensions on the line chart in order to compare daily sales for the chosen years:

1. Date(Date,'MM/DD') - custom dimension

2. Year

Unfortunately, it creates duplicated dimensions equal to the number of years I have and does not combine it (in my example i have three years horizon and it creates three 01/01 values, 02/01 values and so on)

PS: I am still able to make it when the dimension is "Day of the Year" (see the screenshot below), but is does not work for me - I need to see actual dates (DAY and MONTH) on the X-axis.

Screenshot_28.jpg

can you help me please

1 Solution

Accepted Solutions
sunny_talwar

My bad... where did you put the extra bracket, here?

Date(SetDateYear(Date, Year(Today())), 'MM/DD')

View solution in original post

10 Replies
ziabobaz
Creator III
Creator III
Author

Guys

I'm still struggling with this

I am trying to create custom dimension where, for example, February,23,2011 would show as 02/23

1. I created interim dimension MonthNumber = num(month). It works.

2. Then I am trying to create dimension Month&Date = day([date])&"/"&[monthnumber]

It won't allow this as [monthnumber] is invalid filed name. Why?

Thank you

Screenshot_31.jpg

sunny_talwar

May be try like this for your calculated dimension

Date(SetDateYear(Date, Year(Today()), 'MM/DD')

vinieme12
Champion III
Champion III

OR

DATE([date],'MM/DD')

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
ziabobaz
Creator III
Creator III
Author

Yeah
I just figured it out myself
Date([Дата], 'MM/DD')

Didn't realize that I can just omit the YY

thank you, Guys

ziabobaz
Creator III
Creator III
Author

it is not working actually
The appearance is correct (MM/DD), but somehow it still stores the YY in the Dimension

That's what I ended up with:

num(month(DATE),'00')&'/'&Day([DATE])

And that's how it looks like:

Screenshot_32.jpg

sunny_talwar

Did you give this a shot?

Date(SetDateYear(Date, Year(Today()), 'MM/DD')

ziabobaz
Creator III
Creator III
Author

returns the error (although I ammended the formula with one more closure bracket)

sunny_talwar

My bad... where did you put the extra bracket, here?

Date(SetDateYear(Date, Year(Today())), 'MM/DD')

ziabobaz
Creator III
Creator III
Author

no, in the end
now it works, thank you

although i can't understand why we need point (2) below:

1. it takes the DATE

2. replaces the original year with the year from the latest available date

3. then it cut's the year off