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: 
MeeraAgrawal
Creator
Creator

Set Analysis Expression

Hi All,

I am new in Qlik Sense, can you please help me out this expression what's I am doing mistake ?

sum of unit sold=sum({[Unit Sold]},Sales Data)

Labels (2)
1 Solution

Accepted Solutions
Durgadevikumar
Partner - Contributor III
Partner - Contributor III

Hi Meera,

In script editior,

please be noted that the variable name always start with letter "v".

can you pls try this below expression

let vrevenue= 'Sum(Sales)*Sum(Stock)' // its working perfectly for me

if it not matching your answer then try separate variable in data load editor or front end  variable overview 

let vsales= 'sum(Sales)';

let vstock= 'Sum(Stock)';

Let vrevenue= 'a*b';

i hope it will work

Regards,

Durga

View solution in original post

3 Replies
Durgadevikumar
Partner - Contributor III
Partner - Contributor III

Hi,

Set analysis mainly consist of set identifiers, set modifiers and set operators. if you want to understand the set analysis briefly means kindly visit the below link,

https://community.qlik.com/t5/QlikView-Documents/Set-Analysis-syntaxes-examples/ta-p/1491810  

and you need a sum of unit sold then 

=sum({$}[Unit Sold]) 

here why you need an sales data or whether you filter out by Sales data 

Regards,

Durga

MeeraAgrawal
Creator
Creator
Author

Hi Durgadevikumar

Thanks for your response I have sales data I want to calculate Revenue from two field one is unit sold and another price per unit.....

and I am doing this like

=Sum([Unit Sod])*Sum([Price per Unit]) 

and wants to assign variable like Let Revenue=Sum([Unit Sod])*Sum([Price per Unit]) 

but first issue that I am facing is - not able to find data load editor to use Let Command and  second my answer is showing wrong while calculating Revenue like the above expression.

Durgadevikumar
Partner - Contributor III
Partner - Contributor III

Hi Meera,

In script editior,

please be noted that the variable name always start with letter "v".

can you pls try this below expression

let vrevenue= 'Sum(Sales)*Sum(Stock)' // its working perfectly for me

if it not matching your answer then try separate variable in data load editor or front end  variable overview 

let vsales= 'sum(Sales)';

let vstock= 'Sum(Stock)';

Let vrevenue= 'a*b';

i hope it will work

Regards,

Durga