Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have two tables and I want to print the most recent month from SalesTable
If I had another column marking 'Sold' measure (e.g. Measure) I could do this:
max({<Measure={"Sold"}, YEAR ={$(=max(Year))}>} Month) -- and this would give me 11
is there a way to pick that most recent month in a table without adding another column?
SalesTable:
Month, Year, Sold
11, 2018, 29
10,2018, 40
.
.
PlanTable:
Month, Year, Predicted
12, 2018, 30
11,2018, 45
10,2018, 37
.
.
I would say it will be easier if you add 1more column.
SalesTable:
Load *,
'Sales' as Source_Flag;
Load * Inline [
Month, Year, Sold
11, 2018, 29
10,2018, 40
];
.
.
PlanTable:
Load *,
'Plan' as Source_Flag;
Load * Inline [
Month, Year, Predicted
12, 2018, 30
11,2018, 45
10,2018, 37
];
And in expression you can use
Max({<Source_Flag = {"Sales"}>}Month)
I am generating the tables using generic load. Although what you described is also possible with generic load, it makes my script unnessarly long to add new column and drop table. So if some how its possible to spesify a table that would really solve my problem.