Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

calculate revenue in script

Hi there qlikview community,

I am pretty new here and was wondering if I can calculate an additional object called Revenue. I have a data set in Excel which contains both the price and sold qualitities. It does not contain the Revenue as such (of course I can do it in Excel, but want to know if and how to do it in the script.

I tried : sum ([current Price]*[quantity]) as Revenue but with that I failed...

Thanks in advance for your help !

Rob

1 Solution

Accepted Solutions
maxgro
MVP
MVP

load

     ....

     [current Price],

     quantity,

     [current Price]*[quantity] as Revenue,

     ...

from

     yourexcel

View solution in original post

7 Replies
maxgro
MVP
MVP

load

     ....

     [current Price],

     quantity,

     [current Price]*[quantity] as Revenue,

     ...

from

     yourexcel

Not applicable
Author

Test this!

Not applicable
Author

Thanks very much sir !

I try to raise the bar a bit. The same file contains a new Price as well (so old and new Price). I also need to calculate the same quantities against the new Price in order to get the difference out.

Can that be added to the script as well ? It seems that the 2 items that will be combined into a new item must be underneath each other... I tried to duplicate the quantities and do the same math, but that trick did not work...

Can you help me with that one too ?

Rob

maxgro
MVP
MVP

if I understand,

if I don't post some rows of your excel and the result you want

load

     ....

     [current Price],

     quantity,

     [current Price]*[quantity] as Revenue,

     ...

     [new Price],

     [new Price]*[quantity] as [New Revenue],

     ([new Price] - [current Price])*[quantity] as [Revenue Diff],

     .....

from

     yourexcel

Not applicable
Author

WP_20141007_20_55_44_Pro.jpgHi Massimo,

It seems that this does not work. I believe there is a conflict if I use quantity twice?

How can I btw attach an Excel file, I can only add pics and Videos here...? Luckily my Status is rookie 🙂

I made a pic, just to keep going 🙂

I would require calculated fields for column G, H and I...

Not applicable
Author

WP_20141007_20_55_44_Pro.jpgHi Massimo,

It seems it gives a conflict.

This is what I would Need, calculated values for G,H,I.

As I cannot find the button to attach an Excel file, I made a pic of my Screen instead...

Not applicable
Author

Made it, tried another time, missed out some [].

Cheers sir, you made my day !