Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

data model or calculation problem?

Hello,

I try to create a straight table object with data from different fact types.

The dimensions are a mixture of data out of the user and activities table (two different fact types).

The values are calculated visits from a third table (fact type visits).

In my data model activities and visits are stored in the fact table (concatenated), the users are hanging outside linked by the user ID to the fact table.

The result should be a unique line per day with the user information, activity and the calculated visits for that day.

I tried to sum the visits in different ways. I displayed both formulas side by side but in general I need only one calculation per user.

When I use "sum (visits)" I get the visits only calculated on the second line per day for the fact type visits.

When I use "Sum (aggr( NODISTINCT sum( visits ), name, date)) " I get the correct number of visits calculated per day in the above line and a 2nd line for the fact type visits with a wrong sum like in my example.

Is there a way to hide the second line in combination with the aggr function or is this maybe a problem of my data model?

   

namedateweekdayactvitiysum visitssum aggr  visitis
user101.12.2017Frvisit08
user101.12.2017Fr 8104
user104.12.2017Movisit09
user104.12.2017Mo 9108
user105.12.2017Tudouble visit03
user105.12.2017Tu 330
user106.12.2017Wevisit09
user106.12.2017We 9108
user107.12.2017Thrvisit010
user107.12.2017Thr 10130
user108.12.2017Frvisit09
user108.12.2017Fr 9108
user111.12.2017Movisit011
user111.12.2017Mo 11154
user112.12.2017Tuvisit011
user112.12.2017Tu 11154
user113.12.2017Wevisit08
user113.12.2017We 888

I would be glad about any suggestions!

Many thanks in advance and best regards,

Claus

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

I solved this now by moving the activity information from the dimensions into expressions.

E.g. =only(activity)

Now I get a unique line for each user and day.

Best regards,

Claus

View solution in original post

5 Replies
petter
Partner - Champion III
Partner - Champion III

I would think that you need to improve your data model as a preliminary conclusion based on what you tell us.

Is it possible for you to share the data model with us by taking a screenshot from the Table Viewer?

Anonymous
Not applicable
Author

Hello Petter,

Many thanks for your fast response...

Here is a screenshot of the relevant tables.

ID is my user table and the activities and visits are stored in my fact table.

Many thanks and best regards,

Claus

petter
Partner - Champion III
Partner - Champion III

Could you elaborate on how the concatenated FACTS table has been created? Is visit a kind of activity - how are they defined?

Anonymous
Not applicable
Author

Visits and Activities are from different sources and only linked by date or User ID.

The different sources are concatenated loaded into the fact table.

When I export the fact table, I get for each day, user and fact type line.

   

%ID_IDdateactivity (B2)visit activity (MA)FACTTYPE
10000762201.01.2018holiday B2
10000762202.01.2018holiday B2
10000762203.01.2018visit B2
10000762203.01.2018 visitMA
10000762204.01.2018visit B2
10000762204.01.2018 visitMA
10000762205.01.2018visit B2
10000762205.01.2018 visitMA
10000762208.01.2018visit B2
10000762208.01.2018 visitMA
10000762209.01.2018visit B2
10000762209.01.2018 visitMA
10000762210.01.2018visit B2
10000762210.01.2018 phoneMA
10000762211.01.2018visit B2
10000762211.01.2018 e-mailMA
10000762212.01.2018visit B2
10000762212.01.2018 visitMA
10000762215.01.2018visit B2
10000762215.01.2018 visitMA
10000762216.01.2018visit B2
10000762216.01.2018 e-mailMA
10000762217.01.2018visit B2
10000762217.01.2018 e-mailMA
10000762218.01.2018visit B2
10000762218.01.2018 visit

MA

Anonymous
Not applicable
Author

I solved this now by moving the activity information from the dimensions into expressions.

E.g. =only(activity)

Now I get a unique line for each user and day.

Best regards,

Claus