Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Highlighted
georgegv
New Contributor II

Formula Syntax

Hi

I need some help on the following:

The below is an example of what I am trying to do

=(count(distinct{<[Owner Name],Team={'Team 1'}>} [Owner Name])*8)*sum([Days of Work]),

(count(distinct{<[Owner Name],Team={'team 2'}>} [Owner Name])*5)*sum([Days of Work])

 

This is applied to a pivot table .

 

If I do the first part the formula works ( in Red), combining them is the challenge for me

Regards

1 Solution

Accepted Solutions
anushree1
Valued Contributor

Re: Formula Syntax

Please check if this is what you have been looking for:

=if(Team='Team 1',(count(distinct[Owner Name] )*8)*sum([Days of Work]),

if(Team='team 2',(count(distinct[Owner Name] )*5)*sum([Days of Work])))

Also ensure Team 1 and team 2 are defined the same way in data as qlik is case sensitive

7 Replies

Re: Formula Syntax

What are you trying to do? Sum them?

=Count(DISTINCT {<[Owner Name], Team = {'Team 1'}>} [Owner Name])*8) * Sum([Days of Work])
+
Count(DISTINCT {<[Owner Name], Team = {'team 2'}>} [Owner Name])*5) * Sum([Days of Work])

or this

=RangeSum(
Count(DISTINCT {<[Owner Name], Team = {'Team 1'}>} [Owner Name])*8) * Sum([Days of Work]),
Count(DISTINCT {<[Owner Name], Team = {'team 2'}>} [Owner Name])*5) * Sum([Days of Work])
)

 

georgegv
New Contributor II

Re: Formula Syntax

Hi

Thanks for reply however let me clarify. These two syntax should function as an IF statement

Regards
anushree1
Valued Contributor

Re: Formula Syntax

what is the if condition you want to apply here

georgegv
New Contributor II

Re: Formula Syntax

The if Statement must first evaluate based on team because the multiplication factor is specific to team

I trust this helps

Re: Formula Syntax

Would you be able to elaborate with some sample data?

anushree1
Valued Contributor

Re: Formula Syntax

Please check if this is what you have been looking for:

=if(Team='Team 1',(count(distinct[Owner Name] )*8)*sum([Days of Work]),

if(Team='team 2',(count(distinct[Owner Name] )*5)*sum([Days of Work])))

Also ensure Team 1 and team 2 are defined the same way in data as qlik is case sensitive

georgegv
New Contributor II

Re: Formula Syntax

Thanks, this worked