Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
LINKEDIN LIVE: Democratizing data to enhance customer-centricity. JULY 29TH REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
NareshGuntur
Partner
Partner

Chart calculation in the script

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

Labels (4)
1 Solution

Accepted Solutions
Taoufiq_Zarra
Master II
Master II

😵finally

attached a version

left -> load Script

right->UI (your example)

Capture.JPG

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉

View solution in original post

4 Replies
NareshGuntur
Partner
Partner
Author

Guys, Anyone there? 😑

 

-Naresh

pasi_lehtinen
Partner
Partner

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. 

Taoufiq_Zarra
Master II
Master II

😵finally

attached a version

left -> load Script

right->UI (your example)

Capture.JPG

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉

View solution in original post

Brett_Bleess
Support (Former)
Support (Former)

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

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.