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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
matthewp
Creator III
Creator III

Set analysis to ignore selections from a field but also use it in the where condition

I want to do a sum set analysis that ignores selections from a field, but uses the same field as a conditional part of it.

I have tried

=IF([Month] = 'Feb',SUM({<PTYPE = {'TypeA'},[Month]>}VALUEF),SUM({<PTYPE = {'TypeA'},[Month]>}VALUEA))

But it is still changing when Feb is selected in the month

1 Solution

Accepted Solutions
matthewp
Creator III
Creator III
Author

I want to have a simple LINE chart.

Dimension is Month

I Solved this with:

=sum({<PTYPE = {'TypeA'},PM = {'Feb'},[Month]>}VALUEF)+

sum({<PTYPE = {'TypeA'},PM -= {'Feb'},[Month]>}VALUEA)

With PM being the same as Month but an extra field

View solution in original post

11 Replies
Anil_Babu_Samineni

May be using {1} or {1<>}

=IF([Month] = 'Feb',SUM({1<PTYPE = {'TypeA'},[Month]>}VALUEF),SUM({1<PTYPE = {'TypeA'},[Month]>}VALUEA))

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
matthewp
Creator III
Creator III
Author

If i select Jan it still changes

Anil_Babu_Samineni

Off course, It will change. Because, You've written only Feb month of IF Condition. Now tell me your requirement

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
matthewp
Creator III
Creator III
Author

I want it to sum a different value whether the month is feb or not, but also not be affected by month selection

Anil_Babu_Samineni

I would go Alternate states for this s

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Not applicable

Can you show what you want to do? A simple example?

matthewp
Creator III
Creator III
Author

I want to have a simple LINE chart.

Dimension is Month

I Solved this with:

=sum({<PTYPE = {'TypeA'},PM = {'Feb'},[Month]>}VALUEF)+

sum({<PTYPE = {'TypeA'},PM -= {'Feb'},[Month]>}VALUEA)

With PM being the same as Month but an extra field

matthewp
Creator III
Creator III
Author

As below i solved this with:

=sum({<PTYPE = {'TypeA'},PM = {'Feb'},[Month]>}VALUEF)+

sum({<PTYPE = {'TypeA'},PM -= {'Feb'},[Month]>}VALUEA)

However this isnt working when loading in more than 1 year ( for example if they have a PTYPE of TypeA from 2015 it is still using the calculation for VALUEF for all years, not just the year they had the TYPEA

How can i add year into the analysis?

Anil_Babu_Samineni

I really don't know on which cases it is working. Can you tell us what was the PM over here. I meant it has Month names

How can i add year into the analysis?

=sum({<PTYPE = {'TypeA'},PM = {'Feb'},[Month], Year={''}>}VALUEF)+

sum({<PTYPE = {'TypeA'},PM -= {'Feb'},[Month], Year={''}>}VALUEA)

Can you tell, which year you want to add over there

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful