Hi Geeks,
This might be simple but I am breaking my head. I want the calculation that is done on the chart to be implemented in the script.
Open Inventory = Previous Month Closing Inventory(Expression : Above(Closing Inventory))
Closing Inventory = Open Inventory + In Sales - Out Sales
This is easy in the chart as I can use the column labels and get it done but seems tricky in the script.
Reason behind needed in the script: If nothing is selected, all good. But if I select a month, the calculation starts for the selected month. Open Inventory can't take the previous month Closing Inventory. So, if it is done in the script, everything will be pre-calculated.
I tried to be detail to my best . Let me know if any questions and thanks in advance.
-Naresh
😵finally
attached a version
left -> load Script
right->UI (your example)
Guys, Anyone there? 😑
-Naresh
I think you can achieve the desired output with peek() -script function. Just need to use order by clause in order to retrieve the data from prev yearmonth as you desired. Also make sure that you have correct granularity in your script table.
Edit: Alternatively you may ignore the selection in chart expression with set analysis. This way you always have previous month available even though user has made a selection to a specific month.
😵finally
attached a version
left -> load Script
right->UI (your example)
Did Taoufiq's post and example QVW get you what you needed? If so, do not forget to return to your thread and on his post, use the Accept as Solution button to give him credit for the assistance and let other Members know that worked for your use case. If you did something different, consider posting that and mark it, and if you are still working on things, leave an update on what you need.
Regards,
Brett