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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
bharatkishore
Creator III
Creator III

Set Analysis

Hi All,

I have one expression written in set analysis i.e.

=SUM({<Period_NR={'>=$(=vCurrYear_SelectedMnth1)'}>}IB_1)

This expression is working fine and i  getting correct result.

I have written one more expression i.e.

=SUM({<Period_NR={'>=$(=vPrevYear_SelectedMnth1)'}>}IB_1)

This value is showing wrong is there anything i have written wrong.

In the variable vCurrYear_SelectedMnth1 i have written getfieldselections(Period_NR)


In the variable vPrevYear_SelectedMnth1 i have written AddMonths(getfieldselections(Period_NR),-12).


Please suggest


Thanks,

Bharat

14 Replies
bharatkishore
Creator III
Creator III
Author

Thanks Sunny,

But when i try to pass it in a variable then after writing set analysis statement it is showing wrong value.

Please see the attached doc..

sunny_talwar

You seem to need a single day, yet you use >=... can you elaborate why? Seems to work without it

=SUM({<Period_NR={'$(=vPrevYear_SelectedMnth1)'}>}IB_1)

bharatkishore
Creator III
Creator III
Author

Thanks a lot sunny.. But i have two queries can  you please help me whose:

1) If i use only

=AddMonths(GetFieldSelections(Period_NR),-12) it is not working.

But when i use =Date(AddMonths(Max(Period_NR), -12), 'MM/DD/YYYY') it is working.

2) For testing i have written >=, can't i use this one what will happen if i don't use >= request you to suggest me these two.

sunny_talwar

1) Working for me with this

=Date(AddMonths(GetFieldSelections(Period_NR), -12), 'MM/DD/YYYY')

May be an issue with the date format

2) = is for the day and >= is for all day after the selected day (including the selected day)... what do you want?

bharatkishore
Creator III
Creator III
Author

thanks a lot sir...  Thank you so much