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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
JoseGarcia
Creator III
Creator III

Formula query

Hi, 
 I am using this formula to calculate a sum.
The formula only works when I make a selection.
I would like the formula to also show overall sum value if no selection is made.

IF(not Match(Trim(ListItemsFromID_Project),'Heathrow AMP', 'Please select'),sum(master_FPR),Null())

Any ideas, help! 

Thanks  a million!

Labels (1)
2 Solutions

Accepted Solutions
rui24
Creator
Creator

See if this works for you

 

IF((ListItemsFromID_Project = 'heathrow AMP'),
'-',
Sum({1}{< ListItemsFromID_Project -= 'heathrow AMP' >} master_FPR)
)

OR MORE SIMPLE:

IF((ListItemsFromID_Project = 'heathrow AMP'),
'-',
Sum(master_FPR)
)

View solution in original post

rui24
Creator
Creator

The error it's in the end was Num, please see the things i am testing with my fields and values, and next switch to your, is possible to escape something, but if you just copy and past and don't analyze is difficult 

 

IF((ListItemsFromID_Project= 'Victoria Phase 4' or ListItemsFromID_Project = 'Victoria Phase 5'),
'-',
Sum({< ListItemsFromID_Project -= {'Victoria Phase 4','Victoria Phase 5'} >} master_FPR)
)

View solution in original post

17 Replies
rui24
Creator
Creator

Hi JoseGarcia

When you don't identifier atomically assumes {$} which means only do what is in the selection.

Try put {1} which means all of your pretended field, and ignore the selections,

Try this:

IF(not Match(Trim(ListItemsFromID_Project),'Heathrow AMP', 'Please select'),sum({1}master_FPR))

 

Say some feed back if you can or not.

JoseGarcia
Creator III
Creator III
Author

Hi there, 
it did not work. 
it is only summing when a selection is made.

JoseGarcia_0-1671626000287.png

 

rui24
Creator
Creator

Your  code below just work with selections.

IF(not Match(Trim(ListItemsFromID_Project),'Heathrow AMP', 'Please select')

 

To do what you want you just need this:

sum({1}master_FPR))

And this will solve your problem

JoseGarcia
Creator III
Creator III
Author

yes that is correct. but i need to exclude heathrow AMP from my dimension.

rui24
Creator
Creator

Try this

 

Sum({1}{< ListItemsFromID_Project -= 'heathrow AMP' >} master_FPR)

 

 

JoseGarcia
Creator III
Creator III
Author

nearly there 🙂
The sum with no selection is made is working. However when I select heathrow amp, this should not show any values, it does show. just need to exclude heathrow amp from the dimension 🙂

 

rui24
Creator
Creator

See if this works for you

 

IF((ListItemsFromID_Project = 'heathrow AMP'),
'-',
Sum({1}{< ListItemsFromID_Project -= 'heathrow AMP' >} master_FPR)
)

OR MORE SIMPLE:

IF((ListItemsFromID_Project = 'heathrow AMP'),
'-',
Sum(master_FPR)
)

JoseGarcia
Creator III
Creator III
Author

no Luck, Heathrow AMP value still showing when selected 😞

rui24
Creator
Creator

100% sure it is:

 This what you want to not show ?     ListItemsFromID_Project = 'heathrow AMP'