Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
Being new to QV world, trying to understand set analysis and if statement together. I have found below expression. Could someone help me to understand below in detail
If statement and set analysis togather
count({<Year=>}if(product='a',sale))
Thanks In advance,
Priya
All you are doing here is to ignore selection in Year field and Counting those sales where Product = 'a'... this can also be written like this
Count({<Year, product = {'a'}>} sale)
Thanks Sunny but still I feel that below two expressions are different since both expressions are giving two different results when made a different selection
Count({<Year, product = {'a'}>} sale)
count({<Year=>}if(product='a',sale))
When I make any new selection in Product field then below is the result.

Hi Priya,
in simple words ,Normally when ever we have so many conditions we will go for Set Analysis on behalf of nested-If statements,
it means, sum set of data is separating from the entire set of data (Set Analysis).
coming to your example
1) Year = we call this one By passing the Filter ,simple example we are skipping the Filters which are user selections
in the field Year
2) If(Product='a',Sale) here we are finding the amount of sales when product='a'
count({<Year=>}if(product='a',sale))
Let us know if you didn't clear your doubt.
This will behave the same way now
Count({<Year, product *= {'a'}>} sale)
Read about the asterisk here