Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
aarohipatel
Creator II
Creator II

Set Analysis Case

Hi All,

I have the following fields in one of my application:

1.YEAR_MONTH

2.ITD_PAID

I am trying to achieve the following case:

If YEAR_MONTH=2016 Then 0 Else Current Year ITD_PAID - Previous Year ITD_PAID.

Please advise

Thanks in advance.

 

15 Replies
jyothish8807
Master II
Master II

else you have to create the new field in back end.

Best Regards,
KC
aarohipatel
Creator II
Creator II
Author

Thank you very much KC!
jyothish8807
Master II
Master II

You are welcome!

Best Regards,
KC
aarohipatel
Creator II
Creator II
Author

Hi KC,

The suggestions you have provided did answer my question but in some cases it is not working for my requirement.

Please see the attached qvw with additional  requirement mentioned in a text box in the UI.

Please advise.

 

Thank you in advance.

jyothish8807
Master II
Master II

Hi Aarohi,

 

Try this. Best approach to fulfill your requirement will be to create the fields in the back end.

Best Regards,
KC
aarohipatel
Creator II
Creator II
Author

Hi KC,

I have followed the approach suggested by you to create the fields in back end (using Previous function)and it works fine.

But wanted to know how do we handle filters. I have many filters that need to be effective towards the net values.

For example, I have a filter 'Region' in a list box. When I make selections in the List box, it is not reflecting to the Net values.

I did try to pull region into the resident load but the Net values are getting affected.

B:
load
Year,
Year_month,
Region,
ITD_PAID,
if(Year=2016,0,ITD_PAID-Previous(ITD_PAID)) as NetPaid;
Load
Year,
Year_month,
Region,
Sum(ITD_PAID) as ITD_PAID
resident A
group by
Year,
Year_month,
Region
order by Year,Year_month,Region;

 

Also, wanted to check, instead of doing all this in back end, is there a way to do it in front-end with set analysis or any other approach apart from above function? Will there be any drawbacks with Set Analysis?

Please advise