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: 
Not applicable

Selecting a value based on different field

Hi Guys

My question is based on the sample table below. I would like to sum up the figures in column 'Value' (Blue) ONLY IF the text in column 'Name' reads 'Price' (Red). Please assist. I tried the following but i am not getting it right: "IF(Name like '%Price%', SUM({$}  DISTINCT Value), value=0)"

TicketNumberParameterIdAccNumberTicketCenterTicketTypeTicketGroupNameValue
T1822683A147InstallationsInstalInstallationPrice499
T1822684A147InstallationsInstalInstallationEngineerSteve
T1822685A147InstallationsInstalInstallationProductId501
T1822686A147InstallationsInstalInstallationUsernameadsl
T1822687A147InstallationsInstalInstallationBillingPeriod3
T182377112A368Stock AllocationInstalInstallationPrice2356.38
T182377113A368Stock AllocationInstalInstallationEngineerInstaller
T182377114A368Stock AllocationInstalInstallationProductId268
T182377115A368Stock AllocationInstalInstallationUsernameadsl2
T182377116A368Stock AllocationInstalInstallationBillingPeriod1
T227681221A19Customer SupportCustomer ServiceSupportEngineerAndrew
T227681223A19Customer SupportCustomer ServiceSupportUsernamehome

Kind Regards

Roots

Labels (1)
1 Solution

Accepted Solutions
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Try sum({<Name={'Price'}>} Value)


talk is cheap, supply exceeds demand

View solution in original post

4 Replies
Not applicable
Author

Hi,

You can try this:

=if(Name = 'Price',sum(Value))

Regards,

Janzen

Not applicable
Author

Thank you Janzen for the response, unfortunately its still not returning anything.

Strangely if i add another variable like: =if(Name = 'Price', Value, sum(Value)) it returns results but the problem is that it is picking the wrong values (looks like its picking the first figure it encounters even though it is not a Price.

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Try sum({<Name={'Price'}>} Value)


talk is cheap, supply exceeds demand
Not applicable
Author

Thank you Gysbert, this solution worked perfectly.

Thank you Janzen for your assistance too.