Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
cancel
Showing results for 
Search instead for 
Did you mean: 
alec1982
Specialist II
Specialist II

IF Statement error

Hi,

I have the following IF statement and it is giving me error.

Anybody can help.

if  ((Year([Payment Date]) = Year(ExpenseStartDate)) ,

                            ([Expense Amount (USD)]*2) ,

            If  (Year(PaymentDate)> Year([ExpenseEndDate])),

                            ([Expense Amount (USD)]*3),

           

            If  (Year(PaymentDate)< Year([ExpenseEndDate])),

                            ([Expense Amount (USD)]*3),

                           

                                    [Expense Amount (USD)])  as [Expense Amount (USD)]

Thanks,

1 Solution

Accepted Solutions
danielrozental
Master II
Master II

Correct syntax would be

    if  (Year([Payment Date]) = Year(ExpenseStartDate) ,

                            ([Expense Amount (USD)]*2) ,

            If  (Year(PaymentDate)> Year([ExpenseEndDate]),

                            ([Expense Amount (USD)]*3),

          

            If  (Year(PaymentDate)< Year([ExpenseEndDate]),

                            ([Expense Amount (USD)]*3),

                          

                                    [Expense Amount (USD)])))  as [Expense Amount (USD)]

View solution in original post

1 Reply
danielrozental
Master II
Master II

Correct syntax would be

    if  (Year([Payment Date]) = Year(ExpenseStartDate) ,

                            ([Expense Amount (USD)]*2) ,

            If  (Year(PaymentDate)> Year([ExpenseEndDate]),

                            ([Expense Amount (USD)]*3),

          

            If  (Year(PaymentDate)< Year([ExpenseEndDate]),

                            ([Expense Amount (USD)]*3),

                          

                                    [Expense Amount (USD)])))  as [Expense Amount (USD)]