Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
vikasmahajan

day & Month with last year and current year comparision

DEAR ALL,

I WANT TO DISPLAY  OP LIKE THIS

DAY MON       CY              LY

--------------------------------------------------

09/10              12000          500

10/10               15000         600

CURRENT YEAR AND LAST YEAR DATE MONTH & DAY IF SAME SHOULD SHOW IN ONE LINE.

THANKS

BYE

Hope this resolve your issue.
If the issue is solved please mark the answer with Accept as Solution & like it.
If you want to go quickly, go alone. If you want to go far, go together.
2 Replies
Not applicable

Add a PY flag to your script: inyear(AddYears(DATE, 1), $(vToday), 0) * -1 AS PY

I had to do it in another table, since I don't have access to your Excel file, but you can see it in action.

EDIT: Sorry, I misunderstood the issue. The issue is with DayMon. Since you are just formatting the date, QlikView "remembers" that these dates are different, even though the new values look the same. You need to use string concatenation to recreate that field: Num(Day(DATE),'##') & '-' & Num(Month(DATE), '##') As NewDayMon

Fixed the sample file.

vikasmahajan
Author

Dear Sir,

Many Thanks Work like Champ.

Regards

Vikas Executive IT

Hope this resolve your issue.
If the issue is solved please mark the answer with Accept as Solution & like it.
If you want to go quickly, go alone. If you want to go far, go together.