Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Make your voice heard! Participate in the 2020 Wisdom of Crowds® Survey. BEGIN SURVEY
Highlighted
abhaysingh
Valued Contributor II

Expression help set analysis

Hi all

i have one field  FIELD whose values are DS and IS, i want to write expression of sales

sum({<FIELD = {'DS'}>} Sales= this give me sales w.r.t DS

sum({<FIELD = {'IS'}>}Sales = this give me sales w.r.t IS

i want to write it in single expression like if i select DS than it will me DS sales else IS sales in single expression....

pls help.

6 Replies
Highlighted
Partner
Partner

Re: Expression help set analysis

Hi use if condition

If (FIELD = 'DS' ,sum({<FIELD = {'DS'}>} Sales),

If (FIELD = 'IS' ,sum({<FIELD = {'IS'}>} Sales)))


Thanks


Highlighted
abhaysingh
Valued Contributor II

Re: Expression help set analysis

i want to write it in set analysis..

Highlighted
Not applicable

Re: Expression help set analysis

Set a variable like:
vField  =if(GetSelectedCount(Field)>0,concat(GetFieldSelections(Field),','),'IS')

then use the Expression:
sum({<Field={"$(vField)"}>} Sales)

Highlighted
Not applicable

Re: Expression help set analysis

Maybe like attached? Similar to above posts

Highlighted
manoj217
Contributor III

Re: Expression help set analysis

so you are asking you have a list box if you select DS it need to show sales WRT DS right

Highlighted
manoj217
Contributor III

Re: Expression help set analysis

if (getfieldselections(fields)='DS',sum({<FIELD = {'DS'}>} Sales,sum({<FIELD = {'IS'}>}Sales)