Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Modernize Your QlikView Deployment webinar, Nov. 3rd. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Creator II
Creator II

If logic help

Hi Experts,
Can any one please help me on below requirement.
I have an Average Net Amount expression like below here I am dividing the Sum of Net Amount by Number of Repairs.

Sum(Aggr(
(Sum({<[Date]={">=$(=addmonths(today(),-12))"},[Type]={'Level1'},[ Name]={'AA','BB','CC','DD'}>}[Net Amount])

/
Count({<[Date]={">=$(=addmonths(today(),-12))"},[Type]={'Level1'},[ Name]={'AA','BB','CC','DD'}>}distinct[Repairs])

),[MonthYear]))


Here requirement is
when [Status] = Completed then don't add any VAT on [Net Amount] need to consider the actual amount like(Sum({<[Date]={">=$(=addmonths(today(),-12))"},[Type]={'Level1'},[ Name]={'AA','BB','CC','DD'}>}[Net Amount]) but
when [Status] = Not Completed then need to increase 30% on Net Amount value
Please help me to write the logic.

Thanks in advance.

1 Solution

Accepted Solutions
Highlighted
Specialist III
Specialist III

May be this:

Sum(Aggr(
(Sum({<[Date]={">=$(=addmonths(today(),-12))"},[Type]={'Level1'},[ Name]={'AA','BB','CC','DD'}>} If([Status] = 'Not Completed', 1.3, 1) * [Net Amount])

/
Count({<[Date]={">=$(=addmonths(today(),-12))"},[Type]={'Level1'},[ Name]={'AA','BB','CC','DD'}>}distinct[Repairs])

),[MonthYear]))

View solution in original post

3 Replies
Highlighted
Specialist III
Specialist III

May be this:

Sum(Aggr(
(Sum({<[Date]={">=$(=addmonths(today(),-12))"},[Type]={'Level1'},[ Name]={'AA','BB','CC','DD'}>} If([Status] = 'Not Completed', 1.3, 1) * [Net Amount])

/
Count({<[Date]={">=$(=addmonths(today(),-12))"},[Type]={'Level1'},[ Name]={'AA','BB','CC','DD'}>}distinct[Repairs])

),[MonthYear]))

View solution in original post

Highlighted
Creator II
Creator II

Hi @rahulpawarb 

Could you please explain why 1.3 is considered. I assume for 30% need to multiply with 0.03.

Highlighted
Specialist III
Specialist III

For example, Net Amount is 1,000 and Status is Not Completed then amount should be 1,300:
//Solution 1
=1,000 + (1,000*0.3)
//Solution 2
=1,000 * 1.3

Both the expression will return same result.

Hope this will help.