# New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

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

## Totals in pivot Table not working with IF statement

I am trying to count the frequency of visits of clients based on if they made a transaction on any day.

if ( (Count(distinct ( ([TRANSACTION]) )))>1,1, (Count(distinct ( ([TRANSACTION]) ))) )

I put that in a pivot table, it shows me what i want in the pivot table but the totals always =1

How can I fix it so that the totals show their sum of visits per day

Labels (3)

• ### visits

2 Replies
Highlighted
Valued Contributor III

## Re: Totals in pivot Table not working with IF statement

if ( (Count(distinct ( ([TRANSACTION]) )))>1,1, (Count(distinct ( ([TRANSACTION]) ))) )

count({<TRANSACTION={"=count(distinct TRANSACTION)>1"} TRANSACTION)

Channa
New Contributor II

## Re: Totals in pivot Table not working with IF statement

Much apreciated you reaching out
The formula gave me an error,

But I fixed it like this
Count ({< [TRANSACTION]={"=count( distinct [TRANSACTION])>1"}>} [TRANSACTION] )
But it just gives me a zero.

Removing Distinct works but it shows multiple values ( normal because a Client might do multiple transacctions in the same day)
Count ({< [TRANSACTION]={"=count( [TRANSACTION])>1"}>} [TRANSACTION] )

But i need it to show unique values to count the visits a client does withing a time period

I tried it with count (distinct [days]) but the totals still don´t sum the values