Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set analysis - help

Hi,

Does anyone know how to use the "if statement" correctly in the statement below?

=if(Count(DISTINCT{$<InnbetalingsStatus={'Har innbetalt'}>}AKTORID_FS_LOPENR) Avg([#ReskontroInnbetaltBeløp])*-1

I want to see the average contribution (sum of all payments - ([#ReskontroInnbetaltBeløp])*-1) of all donors that has made at least one payment (InnbetalingsStatus={'Har innbetalt').

2 Replies
avinashelite

Did you not get the exact column details , could you please explain it with the sample data

engishfaque
Specialist III
Specialist III

Dear Christian,

I think you are looking for listed below expressions, please check and use according to your requirements.

Expression 1:

--

=if(Count(DISTINCT{$<InnbetalingsStatus={'Har innbetalt'}>} AKTORID_FS_LOPENR) > 0, Avg([#ReskontroInnbetaltBeløp])) * (-1)

Expression 2:

--

=if(Count(DISTINCT{$<InnbetalingsStatus={'Har innbetalt'}>} AKTORID_FS_LOPENR) > 0, Avg([#ReskontroInnbetaltBeløp])) - 1

Expression 3:

--

=if(Count(DISTINCT{$<InnbetalingsStatus={'Har innbetalt'}>} AKTORID_FS_LOPENR) > 0, Sum([#ReskontroInnbetaltBeløp])) * (-1)


Expression 4:

--

=if(Count(DISTINCT{$<InnbetalingsStatus={'Har innbetalt'}>} AKTORID_FS_LOPENR) > 0, Sum([#ReskontroInnbetaltBeløp])) - 1

Kind regards,

Ishfaque Ahmed