Skip to main content

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
QlikWorld 2023, a live, in-person thrill ride. April 17 - 20, 2023, in Las Vegas! REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
dfigan02
Contributor II
Contributor II

Month + 1 IF Statement

Hello All,

I am trying to create a dimension for a 'Month+1'. I created a varable Month1 which is:

Date

(NumMonth+1 &'/01/' & Year, 'MMM')

This shows the correct date but when I add it to my dimension I get 0

=sum(distinct
if(([Company] = 'USA'
AND [Company] = BudgetCompany
AND [Year]= BudgetYear
AND BudgetMonth = $(Month1)),Budget))/1000

If I add the actual Month Name it works correctly

=sum(distinct
if(([Company] = 'USA'
AND [Company] = BudgetCompany
AND [Year]= BudgetYear
AND BudgetMonth = 'Mar' ,Budget))/1000





2 Replies
Not applicable

if you want to calculate the current month plus one, ie the next month, you can use the expression

Month (Today ()) +1


= sum (distinct
if (([Company] = 'USA'
AND [Company] = BudgetCompany
AND [Year] = BudgetYear
AND BudgetMonth = Month (Today ()) +1, Budget)) / 1000

I hope you serve.

Miguel_Angel_Baeyens

Hello,

Note that QlikView is case sensitive, you your month name must be spelled the same way it is when you do Month(Date).

To get the next month, I'd rather use something like the following:

=Month(AddMonths(Today(), 1))


Hope this helps.