Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

If statement including set analysis

I having been working with this expression for some time now and have been unable to get it to work.

=If([L.R.L. Payment - BLFLRLP] >0,(sum({$<LRL_MMonth={"$(=Date(AddMonths(Max(LRL_MMonth),-1),'MMM-YY'))"}>}[L.R.L. Payment - BLFLRLP])),(Sum([L.R.L. Payment - UBLRLP])))

What I am trying to accomplish is if L.R.L. Payment - BLFLRLP > 0 pull the payment amount from the previous month, if not sum the L.R.L. Payment - UBLRLP payment amount.


This function will need to aggregate sums up multiple levels.


Any help will be much appreciated.

4 Replies
hareeshkumar_gv
Contributor III
Contributor III

Hi Nathan,

try this:-

=If([L.R.L. Payment - BLFLRLP] >0,(sum({$<LRL_MMonth={"$(=month(AddMonths(Max(LRL_MMonth),-1)))"}>}[L.R.L. Payment - BLFLRLP])),(Sum([L.R.L. Payment - UBLRLP])))

Not applicable
Author

Thank you for the reply. Unfortunately that did not work.

hareeshkumar_gv
Contributor III
Contributor III

could you please provide sample qvw, so that i will correct the expression

Gysbert_Wassenaar

If you're using LRL_MMonth as dimension in your chart then set analysis won't work for you. The set is calculated at the chart level, not the row level. You can't (without a great deal of trouble) show data from one LRL_MMonth in the row for another LRL_MMonth value.

Try creating a new field that associates each month with the previous month and use that field as chart dimension instead. See this blog post: The As-Of Table


talk is cheap, supply exceeds demand