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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Conversion of an if expression to set analysis

Hello

I am trying to convert the following if expression into set analysis. But when I change it to set the values change compared to if also change which is not correct obviously as the values should still remain same.

Please advise on how to convert this expression into set analysis

Sum(If( [GL Date]< $(=[StartPeriod]) AND

       ([PARENT REVENUE]='Deferred Revenue' or [Revenue Type]='CLIB') and [Forecast Flag]='N'  and [Schedule On Hold]='N',[Net Amount]))


Thanks

4 Replies
jerem1234
Specialist II
Specialist II

Might not be able to convert all to set analysis, since i am guessing your StartPeriod changes based on dimension?

Try this:

Sum({<[PARENT REVENUE] = {'Deferred Revenue', 'CLIB'}, [Forecast Flag] = {'N'}, [Schedule On Hold] = {'N'}>}if([GL Date]< $(=[StartPeriod]), [Net Amount]))

Hope this helps!

Not applicable
Author

No Jeremy

The values when it was an if still do not match to the set expression.

Any more suggestions are welcome

Thanks

Not applicable
Author

hi

Try like this hope it is helpful

Sum({<[GL Date]={'<[StartPeriod]'},[PARENT REVENUE] = {'Deferred Revenue', 'CLIB'}, [Forecast Flag] = {'N'}, [Schedule On Hold] = {'N'}>}[Net Amount]))

jaimeaguilar
Partner - Specialist II
Partner - Specialist II

Hi, I'm agree with Jerem that you can't convert everything to set analysis, but what about this:

sum({$<[PARENT REVENUE={'Deferred Revenue'}, [Forecast Flag]={'N'}, [Schedule On Hold]={'N'} >

+

<[Revenue Type]={'CLIB'}, [Forecast Flag]={'N'}, [Schedule On Hold]={'N'}>}

If( [GL Date]< $(=[StartPeriod]), [Net Amount] ))