Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
gowrishankarangrybird
Contributor II
Contributor II

How to write Correct set expression for this.  need to show data based on two or three filter. like one filter is Sales Date another one is Country &

I don't have measure. i need to show data based on two or three filter. like one filter is Sales Date another one is Country & City

How to write Correct set expression for this. 

i tried below but i don't know exactly 

if(({<[Sales Date ]=$::[Sales Date ]>},Monthname([Sales Date ])

if({<[Sales Date ]=$::[Sales Date]>},(chr(9650) & ' ' & [EmpName] & ' ' & [Emp ID]))

 

Thanks in Advance

 

1 Solution

Accepted Solutions
gowrishankarangrybird
Contributor II
Contributor II
Author

Works With Alternate State and Expression like : 

count(distinct{<[Sales Date] = $::[Sales Date],Country={'Canada'} >} Quantity)

 

1st Filter in Custom Alternate State  (City)

2nd & 3rd Filter in Expression (SalesDate & Country)

View solution in original post

5 Replies
Mark_Little
Luminary
Luminary

Hi 

Can you just explain what you are trying to achieve, I am not following what it is from you set analysis.

tresesco
MVP
MVP

Set analysis could only be used in an aggregation function. When you say - 'I dont have measure' - it makes difficult to understand your use case. You might have a look into alternate state. Or, try to explain a bit more with an example. 

hic
Former Employee
Former Employee

A couple of points:

  1. You can only use Set Analysis together with aggregations. Or rather, Set Analysis only affects aggregations. Example: Sum({<SetExpression>} Amount)
  2. The set expression is evaluated BEFORE the row-by-row calculation - it is never evaluated row-by-row.  The part to the right of the equals sign is a selection. Which means that you can never have a condition where you compare one field with another.
  3. The If() function takes a normal Boolean expression as first parameter, e.g. [Sales Date ]='2022-11-30' or [Sales Date ]<[Required Date] 
gowrishankarangrybird
Contributor II
Contributor II
Author

Works With Alternate State and Expression like : 

count(distinct{<[Sales Date] = $::[Sales Date],Country={'Canada'} >} Quantity)

 

1st Filter in Custom Alternate State  (City)

2nd & 3rd Filter in Expression (SalesDate & Country)

gowrishankarangrybird
Contributor II
Contributor II
Author

Works With Alternate State and Expression like : 

count(distinct{<[Sales Date] = $::[Sales Date],Country={'Canada'} >} Quantity)

 

1st Filter in Custom Alternate State  (City)

2nd & 3rd Filter in Expression (SalesDate & Country)