Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
paulyeo11
Master
Master

How to plot X axis YearMonth with CY sales with LY sales ?

Hi All

I like to create the chart 1

My issue is i don't have the expression for LY.

My Objective for create this chart is , so that i am able to compare CY sales vs LY sales by month.

Hope some one can give me the expression. ( Now i using sum(cost) is not correct.

Enclosed my QVW file.

Paul

10 Replies
qlikmsg4u
Specialist
Specialist

Use

Month as Dimension

and these are as expressions

sum({<Year = {"$(=Max(Year))"}>}sales) for CY

sum({<Year = {"$(=Max(Year)-1)"}>}sales) for LY

paulyeo11
Master
Master
Author

Hi K N

Thank you vey much for your offer ,  Your solution for Expression is great , it is what i need.  But Diamension = Month , is not what i need , as i need to put YearMonth , so that i can view not only current year i can view last year also.

Paul

sunny_talwar

The application you have shared has only 9 month of data. How do you expect to see anything for LY? Would you be able to share more data points? may be like 24 months of data so that the results can be shown

jagan
Luminary Alumni
Luminary Alumni

Hi Paul,

With MonthName it is very difficult to display, you need to change entire datamodel to calculate it in script.

The best and easy solution is to display is use Month in Dimension

Current Year:

Caption: =Max(Year)

Expression: sum({<Year = {"$(=Max(Year))"}>}sales)

Last Year:

Caption: =Max(Year) - 1

Expression: sum({<Year = {"$(=Max(Year)-1)"}>}sales)

Regards,

Jagan.

paulyeo11
Master
Master
Author

! ! ! !Hi Jagon

Thank you for look at my posting.

My data model have this field Year_n.

I unable to understand how to apply the expression into my chart .

Can you shown ?

Paul

paulyeo11
Master
Master
Author

Hi Sunny

My data have many month , the chart i display i control it display only 9 month .

Paul

qlikmsg4u
Specialist
Specialist

Like this in attached app?

jagan
Luminary Alumni
Luminary Alumni

Hi,

Please find attached file for solution.

Regards,

Jagan.

paulyeo11
Master
Master
Author

Hi Jagan

Thank you very much for your reply again. The solution is not what i want , because the X Axis is not Year Month , So i will try to figure out using other approach.

Paul