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

If Statement for Prior Month

 I have a formula in a chart SUM({<Sales={Sales}>} if (InMonthToDate (OrderDate, Today(), 0), ValueEa)) that shows the cumulative sales of the current month. What I have been requested for is for the first 5 days of the month that value shows the prior month due to month end closing stuff. I'm stuck on this. 

I am assuming I need the if statement if(day(OrderDate)<=5,  NEWFORMULA, OLDFORMULA) but I am unsure of how to write the NEWFORMULA for the prior months sales. Any help would be appreciated. 

1 Solution

Accepted Solutions
Kushal_Chawda

@JustinRamsey  change your new formula to below

SUM({<Sales={Sales}>} if (InMonthToDate (OrderDate, Today(), -1), ValueEa))

View solution in original post

2 Replies
JustinRamsey
Creator
Creator
Author

The if statement at the bottom should be typo on my part.

if(day(today())<=5

Kushal_Chawda

@JustinRamsey  change your new formula to below

SUM({<Sales={Sales}>} if (InMonthToDate (OrderDate, Today(), -1), ValueEa))