Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
hopkinsc
Partner - Specialist III
Partner - Specialist III

help with expression

Hi,

i am trying to write an expression to show total sales qty (SalesQuantity) but excluding any Voided transactions. Voids have a (LineType) of V.

I thought it should be something like

Sum({$<LineType=V>}SalesQuantity

But i cannot get it to work..

Can someone help please?

1 Solution

Accepted Solutions
Not applicable

yes it should be enclosed with {}


Sum({$<LineType -= {V}>} SalesQuantity)


Thanks Marcel! Big Smile

View solution in original post

9 Replies
Not applicable

Hi Hopkinsc,

try this:


Sum({$<LineType -= V>}SalesQuantity)


put a dash before an equal sign to exclude all LineType V

regards

hopkinsc
Partner - Specialist III
Partner - Specialist III
Author

Hi Ronald, I have just tried that but it still returns the sales quantity including VOIDS.

Any other ideas?

marcel_olmo
Partner Ambassador
Partner Ambassador

Maybe i'ts just formatting badly, when I have to exclude something in set analysis I always do it like this :


Sum( {$<[LineType ] -= {V} >} SalesQuantity )
If I don't use { } in the field I don't want to exclude it doesn't work.
hopkinsc
Partner - Specialist III
Partner - Specialist III
Author

Thanks Marcel, but that hasn't worked either....

Not applicable

yes it should be enclosed with {}


Sum({$<LineType -= {V}>} SalesQuantity)


Thanks Marcel! Big Smile

qliksus
Specialist II
Specialist II

I think this will work

Sum( {$<[LineType ] = {"*"} - {V}>} SalesQuantity )

Not applicable

Hi Hopkinsc,

that code should work. if the field LineType is two words enclosed it with []

I attached a file that shows exclusion.

hopkinsc
Partner - Specialist III
Partner - Specialist III
Author

Hi Qliksus,

I have pasted your expression but i am getting an error in expression message.

hopkinsc
Partner - Specialist III
Partner - Specialist III
Author

Hi, thanks everyone for your replies...

I have managed to get it working by using...

Sum({$<LineType -= {V}>} SalesQuantity)

Thanks again. 🙂