Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
zturaiki
Contributor III
Contributor III

data of last six months from the current month?

How can i found the data of the last six months from the current months ?

attached is excel sample data

i have three column : Order ID - Order Month - Order Year

i want to get the total number of order per month for the last six months from the current months.

1 Reply
Not applicable

COUNT(

               {$<

                    Order Month={"$(=month(addmonths(today(),-6)))"},

                    Order Year={"$(=year(addmonths(today(),-6)))"}

               >}

[Order ID])   

Would be better if you transform your varchar month to number and you can use this one:

COUNT(

               {$<

                    Order MonthNum={"$(=num(month(addmonths(today(),-6))))"},

                    Order Year={"$(=year(addmonths(today(),-6)))"}

               >}

[Order ID])