Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Pivot Showing Greater Number When Unfiltered

I have this data set where I want to count accounts that had more than one device to them. When the chart is unfiltered I get a higher number, when I filter it to the month it should the correct answer. Can someone help please.

SCRIPT:

LOAD

    MonthYear,

    Account,

    Device,

    LOG_DATE

FROM [lib://AttachedFiles/Qlik Community.xlsx]

(ooxml, embedded labels, table is Sheet1);

DIMENSION:

MonthYear

EXPRESSION:

aggr(count({< Account = {"=Count(distinct Device) > 1"} >} DISTINCT Account), MonthYear)

Chart Shows this:

WrongAnswer.png

When I filter to individual month i get the right answer.

RightAnswer.png

Any ideas?

I want the calculation to be done on the first end (in pivot table)

1 Solution

Accepted Solutions
sunny_talwar

Try this

Count(DISTINCT Aggr(If(Count(DISTINCT Device) > 1, Account), Account, MonthYear))

View solution in original post

2 Replies
sunny_talwar

Try this

Count(DISTINCT Aggr(If(Count(DISTINCT Device) > 1, Account), Account, MonthYear))

Anonymous
Not applicable
Author

Worked like a charm! Thank you so much!