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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
dmac1971
Creator III
Creator III

Sum using If but only Distinct

Having trouble getting my head around the syntax in Qlikview, coming from an excel background.  I have the following which works but I want to exclude duplicates :

='Standard £ : ' & sum({<[TYPE]={'AFTERMARKET'}, [TYPE={'STANDARD'}>} [SO Line Value])

Ive got a unique identifier in field [id] but no matter what I try I end up getting an error or a zero.  I know I need to use {Distinct [id]} but cant figure where it sits in the expression?

Any help much appreciated....

13 Replies
dmac1971
Creator III
Creator III
Author

Sorry as I'm just starting to get my head around Qlikview, can you explain further?  The expression is used to populate a text box to give a headline, IE total value of an order type etc.

Jason_Michaelides
Partner - Master II
Partner - Master II

I really think you should evaluate your data model and remove duplicate values from the fact table.

Although Prem's solution should work.  What error are you getting?  When you write the expression in the text box are you getting a syntax error (squiggly red underline)?

dmac1971
Creator III
Creator III
Author

Yes syntax error.  I dont want to edit the source file, excel, as my idea is to dump a fresh data file in each week to show backlog etc.

Jason_Michaelides
Partner - Master II
Partner - Master II

You're not making this easy Please paste the exact expression in your text box here so we can look at it...

You don't normally have to edit the source file. You just may need to write some script to transform the source file into a sensible data model for QlikView.