Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
preminqlik
Specialist II
Specialist II

Previous month Sales in Script

Hi , i want to calculate the previous month sales in script

Please find attachment

can any body help me ..

6 Replies
Siva_Sankar
Master II
Master II

Couldn't able to open your file. Refer the following.

http://community.qlik.com/message/350909#350909

Regards.

Siva

preminqlik
Specialist II
Specialist II
Author

i want to caclulate in script level...not in the front end..

Anonymous
Not applicable

Prem

Is the attached what you are after ?

Best Regards,     Bill

preminqlik
Specialist II
Specialist II
Author

sivasankar hey kamal hasan thanks for sending some thing useful...but i have to calculate in script level....

Bill Markham thanks for looking to my question..am attaching screen shot as per your calculation ... please observe pre month.png

Many thanks

Prem

Anonymous
Not applicable

Prem

If you want to slice and dice it over dimensions then why not do it in the GUI as Siva suggested & gave you the link for.

But if you do have a compelling reason to do it in the script then I would be curious to know what this reason is ?

Best Regards,     Bill

jerem1234
Specialist II
Specialist II

To get what you desire in the script, you'll have to order by Item as well:

order by Item, Date;

I would also change your Month field to:

Date(Date, 'MMM YYYY')

so it separates the months by Year also.

Please find attached. However it won't work unless you have an Item selected.

Maybe like Bill and Siva mentions, you could just use an expression in chart.

Maybe an alternative to whats listed is to use the above function in a straight chart?

Please find attached.

Hope this helps!