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)
17 Replies
JoseGarcia
Creator III
Creator III
Author

you are a genius! 

this statement worked nicely!

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

Thanks a million for the great amazing wokr!

JoseGarcia
Creator III
Creator III
Author

@rui24 

using the same principle, why my statement below is giving me error:

 

IF((ListItemsFromID_Project = 'Victoria Phase 4','Victoria Phase 5', 'Farncombe to Petersfield', 'ETCS Stage B&C', 'Ashford IECC Renewal', 'Three Bridges ARS', 'Barking Riverside Extension'), '-', Sum({1}{< ListItemsFromID_Project -= 'Victoria Phase 4','Victoria Phase 5', 'Farncombe to Petersfield', 'ETCS Stage B&C', 'Ashford IECC Renewal', 'Three Bridges ARS', 'Barking Riverside Extension' >} master_FPR) )

rui24
Creator
Creator

Here it is

 

Please understand the logic when you use 2 or more need to add 1 of this logical operators:

OR 

AND 

 

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

JoseGarcia
Creator III
Creator III
Author

@Rui 
 I think we are missing a bracket?

JoseGarcia_0-1671636622969.png

 

rui24
Creator
Creator

The error is was missing some ' and some duplicate too

This should work

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

JoseGarcia
Creator III
Creator III
Author

I think nearly there! 
we have an error on the formula:

JoseGarcia_0-1671637661815.png

 

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)
)

JoseGarcia
Creator III
Creator III
Author

my apologies! 🙂

It did work great!

thanks a million for your support on this! 

Merry Christmas and happy NY to you and your loved ones!