
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dividing measures from two different tables
Hi, I have data in two tables, in both I have the same measure "Number of NIPs". I would like to divide the value of the second table by the value from the first table. How can I do this?
- Tags:
- dividing
- two tables
- « Previous Replies
-
- 1
- 2
- Next Replies »

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
try this way
Sum({<TableName={'Table2'}>} [Number of NIPs]) / Sum({<TableName={'Table1'}>} [Number of NIPs])

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
where should I put this expression?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I believe you might have two isolated tables in the script and renamed two different measures as 'Number of NIPs' for both in the chart. Otherwise, they would automatically be associated if not renamed.
solution- You need to join both tables based on date then automatically you can use date as dimension and sum of first table filed (no of **NIPs**) then divide second table field (no of **NIPs**)..
If you have a single table with two date fields and one measure column, it would be good to create a common calendar between the dates. Replicating the table into two fact tables and creating a common calendar table to link both facts . Subsequently, you can use the common calendar month as a dimension and include measures from both tables. Additionally, you can create a third measure for division using columns from both tables.
Best Regards,
Arunesh

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
you can try this as well. second table field name use accordingly .. it must have some different have.
sum(Number of NIPs)/sum{"=Case acceptance date=Date of entry of the case"}>} Number of NIPs)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I had to change "Number of NIPs" to "**bleep**" and there is no error, but the value is invalid.
Sum({<TableName={'Table2'}>} [**bleep**]) / Sum({<TableName={'Table1'}>} [**bleep**])

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
it does not work

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
if the column values are same in both dimensions then try something like this
tab1:
mapping load Id1 as ID,Sales;
load * Inline
[
Id1,Sales
1,10
2,10
3,10
];
tab:
load ID,Sales,Sales/applymap('tab1',ID) as Div;
load * Inline
[
ID,Sales
1,100
2,200
3,300
];

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
in both tables I have different dimensions for the date, but both dates are in the same mmm-yyy format. The measure is the same for both tables.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
are the values for Date different in both tables

- « Previous Replies
-
- 1
- 2
- Next Replies »