Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

using condition in set analysis

Hi all,

i have wrote this syntax combining IF condition and set analysis.

if (Date < Today() and Date>='01/01/2000' and vComission='0',Sum ({$<Is708={'0'}>}Currency),if(Date < Today() and Date>='01/01/2000',Sum (Currency)))

I wish to put the condition inside the set analysis so the table would load faster

thanks for any help

Avner

1 Reply
Anonymous
Not applicable
Author

Hi Avner

In set analysis, each condition could be placed between symbols "<" and ">" in code block: {$< >} before expression

sum(

        {$<

           [DocName]={'SalesDashboard.qvw'},

           [Authenticated_User]={'acme\john.brown'}

        >} (Session_Duration/Session_Start_Count/3600)

    )

In this example, the expression will be calculated by conditions docname = 'SalesDashboard' and AuthenticatedUser = 'acme\john.brow'

If you use selection lists of fields year and month for data reduction  in your app, use this:

num(

sum({$<MyYear={$(=max(MyYear))}, %DateID={$(='">='&Floor(MakeDate(MyYear,MyMonth,1))&'<='&Floor(MonthEnd(MakeDate(MyYear,MyMonth,1)))&'"')}>} SalesAmount), '#.##0')

in this example, i have daily sales in my data base, and the user can obtain total of sales by month

hope I have helped you!

Evandro Segura