Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
lionking15
Creator
Creator

create straight table

hi

i am having a table consist of fields Customer,sales id,sales,ShipDate,product,quantity and i have linked ShipDate to master calender.

and the issue is that i have to create

straight table having below expressions

Current Year Sales,  Previous Year Sales, Current Month Sales, Previous month Sales and product as dimension


thanks!!!!!!!!

8 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

You need to take help of the set analysis to achieve this.

Have a look at the link below for more info on how to find the current year and previous year sales.

Set Analysis for certain Point in Time

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
miguelbraga
Partner - Specialist III
Partner - Specialist III

To do this you need to add a Calculated Dimension. Here are some hints on how to achieve this:

Calculated Dimensions

YTQ, QTD, MTD and WTD

Year-over-Year Comparisons

YTD and MTD Calculation in Qlikview - YouTube

Hope this might help you

Regards,

MB

Anonymous
Not applicable

Hi

Try this: Current Year Sales

Sum({<Year=, Quarter=, Month=, ShipDate={'>=$(=YearStart(Today()))<=$(=Today())'}>} Sales )

Previous Year:

Sum({<Year=, Quarter=, Month=,  ShipDate={'>=$(=YearStart(Today(), -1))<=$(=Today())'}>} Sales )



Hope it helps!!

Anonymous
Not applicable

Hi

For Current Month:

Sum({<Year=, Quarter=, Month=, ShipDate={'>=$(=MonthStart(Today()))<=$(=Today())'}>} Sales)


Previous Month:


Sum({<Year=, Quarter=, Month=,  ShipDate={'>=$(=MonthStart(Today(), -1))<=$(=Today())'}>} Sales )


Hope it helps!

Anil_Babu_Samineni

Current Year Sales

Sum({<Year = {Max(Year(ShipDate))}>}Sales)

Previous Year Sales

Sum({<Year = {Max(Year(ShipDate)-1)}>}Sales)

Current Month Sales

Sum({<Month = {Max(Month(ShipDate))}>}Sales)


Previous Month Sales

Sum({<Month = {Max(Month(ShipDate)-1)}>}Sales)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
lionking15
Creator
Creator
Author

what is wrong in this syntax: Sum({$-1<Year={year(today())}>}total_sales)

lionking15
Creator
Creator
Author

what is wrong in this syntax: Sum({$-1<Year={year(today())}>}total_sales)

oknotsen
Master III
Master III

Should most likely be this:

Sum({$-1<Year={$(=year(today()))}>}total_sales)


So what you missed was the dollar sign expansion.

Dollar-sign expansions ‒ Qlik Sense

May you live in interesting times!