Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
QlikWorld 2020: Join us May 11 - 14, 2020 in Phoenix, AZ. Register early and save $400. Learn More
Highlighted
ziabobaz
Contributor 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

Re: comparing daily sales between years

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
Contributor III

Re: comparing daily sales between years

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

Re: comparing daily sales between years

May be try like this for your calculated dimension

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

vinieme12
Esteemed Contributor II

Re: comparing daily sales between years

OR

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

ziabobaz
Contributor III

Re: comparing daily sales between years

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

Didn't realize that I can just omit the YY

thank you, Guys

ziabobaz
Contributor III

Re: comparing daily sales between years

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

Re: comparing daily sales between years

Did you give this a shot?

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

ziabobaz
Contributor III

Re: comparing daily sales between years

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

Re: comparing daily sales between years

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

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

View solution in original post

ziabobaz
Contributor III

Re: comparing daily sales between years

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