Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
hopkinsc
Partner - Specialist III
Partner - Specialist III

Help with Set Analysis Expression...

Hi, i am trying to write an expression to bring back total SalesValue - Total Voids for a transaction.

I know how to calculate total sales value - Sum(SalesValue), but this also includes VOID values. A void is obviously not part of the transaction value, so i need to deduct this off.

my fields are

SalesValue (the price of each item)

LineType (specifies if the transaction line is a SALE/ VOID/REFUND etc)

I have tried the following....

Sum({$<LineType ='V'>}SalesValue)

but this just displays the void value.

Can anyone help?



1 Solution

Accepted Solutions
Miguel_Angel_Baeyens

Hello,

Use

Sum({< LineType -= {'V'}, TransactionType = >} SalesValue)


to ignore the current selection in TransactionType.

Hope that helps

View solution in original post

15 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

Hi

This might do what you want:


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


Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable

shouldn't be somethig like

Sum({$<~LineType = {'V'}>}SalesValue)
?

hopkinsc
Partner - Specialist III
Partner - Specialist III
Author

Thanks Jonathan,

I have already tried that one, but i think i know why it doesn't work....

I need the expression to disregard the selection (TransactionType).

How would i include this?

jonathandienst
Partner - Champion III
Partner - Champion III

You did not mention TransactionType in the original post, so I am not sure what you mean.

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
hopkinsc
Partner - Specialist III
Partner - Specialist III
Author

I need to show the total SalesValue (but exclude the Transaction Type selection) minus Voids.

hopkinsc
Partner - Specialist III
Partner - Specialist III
Author

Any more help with this anyone?

Not applicable

Hi,

The transaction Type is another field or is the same LineType?

Regards.

hopkinsc
Partner - Specialist III
Partner - Specialist III
Author

It is another field. i want anything from this selection excluded.

Not applicable

Hi , I think this expression can help you.

Because you want to use not like condition

here is one expression you can do desired changes in this set analysis expression and can get desired result......

= (-count({$<YM={'$(vCurrentyearmonth)'},Year=,Quarter=,MonthName=,BDO_DSA={'DSA'},Source={'SanctionNo'},BDO_NAME={'CONN*'}>} DISTINCT FILENO)

Regards,

Dushyant