Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have this table where i want to show on first day of month the cumulative amount
below expression i Used but i gives me incorrect total
If(
Date([Data ordine]) = MonthStart(Today()) and
Month([Data ordine]) = Month(Today()) and
Year([Data ordine]) = Year(Today()),
Sum(Total If(
Archivio = 'O' and
Date([Data ordine]) <= MonthStart(Today()) and
Month([Data consegna]) = Month(Today()) and
Year([Data consegna]) = Year(Today()),
Importo
)),
Sum({<Archivio = {'O'}>} Importo)
)
in fonrt of 01/10/2025 it is sgowing correct value but its doesnot add it in partial sum wha is solution to this
Please help ?
Okay .Thank you @marcus_sommer
Could you please confirm ?
@PrashantSangle
@marcus_sommer As per the link you shared I studied the post
FirstOrderDatePerMonth:
LOAD
Year([Data ordine]) AS YearDel,
Month([Data ordine]) AS MonthDel,
Min([Data ordine]) AS FirstOrderDate
RESIDENT FATTI
WHERE Archivio = 'O'
GROUP BY
Year([Data ordine]),
Month([Data ordine]);
Deliveries_Cumulative:
LOAD
[Data ordine],
[Data consegna],
Importo,
Archivio,
Year([Data ordine]) AS YearDel,
Month([Data ordine]) AS MonthDel
RESIDENT FATTI
WHERE Archivio='O';
JOIN (Deliveries_Cumulative)
LOAD
YearDel,
MonthDel,
FirstOrderDate
RESIDENT FirstOrderDatePerMonth;
Deliveries_Daily:
LOAD
[Data ordine],
[Data consegna],
'Daily' AS RecordType,
SUM(Importo) AS Importo_Result
RESIDENT FATTI
WHERE Archivio='O'
GROUP BY
[Data ordine],
[Data consegna];
Cumulative_Result:
LOAD
FirstOrderDate AS [Data ordine],
MonthStart([Data consegna]) AS [Data consegna],
'Cumulative' AS RecordType,
SUM(Importo) AS Importo_Result
RESIDENT Deliveries_Cumulative
WHERE [Data ordine] <= FirstOrderDate
GROUP BY FirstOrderDate, MonthStart([Data consegna]);
DROP TABLE FirstOrderDatePerMonth, Deliveries_Cumulative;
EXIT SCRIPT;
is this correct ?
Thanks
Dipti Ahire
It seems to be a transfer of the logic from the UI to the data-model - which is more as above hinted - but if it could be done here it should be done there. But I could not justify if it's working against your data-set and requirements.
any error are you getting after that.. I lost between brackets of that expression.