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

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
ivanoski
Contributor III
Contributor III

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 (1)
2 Replies
Channa
Specialist III
Specialist III

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

 

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

 

Channa
ivanoski
Contributor III
Contributor III
Author

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