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

Announcements
Check out our latest virtual session where BARC Fellow, Doug Laney, highlighted the opportunities data monetization can offer enterprises. Watch here.
cancel
Showing results for 
Search instead for 
Did you mean: 
sakshikaul
Creator II
Creator II

Expression to calculate net sold quantity

Hi all,

I have a querry regarding creating a sell through report. Following is the expression which shows the comparison between two seasons

=sum({stateperA< [Season Code]={'17A'} >} quantity_sold)

- sum({stateperA< [Season Code]={'17A'} >} quantity_returns)

Following above code is giving correct result but I want the user should have a freedom to select any season code so how to write an expression for the same ?

17 Replies
Anil_Babu_Samineni

May be use like Implicit Set Operators

sum({stateperA< [Season Code]/={'17A'} >} (quantity_sold-quantity_returns))

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
sakshikaul
Creator II
Creator II
Author

But I have to show comparison between two seasons so how is this possible without set analysis ?

sakshikaul
Creator II
Creator II
Author

This is giving an error

sakshikaul
Creator II
Creator II
Author

yes i can do that but I have to also show comparison between two year ie yaer 2017 and 2018 so in that case this above idea is not useful

sakshikaul
Creator II
Creator II
Author

Hi

according to me i can get solution from this expression but this expression is not giving any result its giving 0 as value so please help what could be done?

sakshikaul
Creator II
Creator II
Author

Hi

Here is my expression for sold (QTY)(CY). The following expression is not giving result

=sum( {stateperfB<  Sold_Date = {">=$(From)<=$(To)"},[Season Code] = {$(Master_CurrentSeason)} >} quantity_sold)- sum( {stateperfB< Sold_Date = {">=$(From)<=$(To)"}, [Season Code] = {$(Master_CurrentSeason)} >} quantity_returns)

Anonymous
Not applicable

Hi,

if Season Code is having space in it so you have to mention the Season Code Field in single quotes

eg['Season Code'].

Regards

Ritesh

balabhaskarqlik

May be use this:

=sum({<stateperA=p(stateperA), [Season Code] = {"$(=getfieldselections([Season Code]))"} >} quantity_sold)

-

sum({<stateperA=p(stateperA), [Season Code] = {"$(=getfieldselections([Season Code]))"} >} quantity_returns)