Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Data operations

Hello,

this is my issue i have this kind of data set : qlik 1.PNG

I would like for each op calculate lthis expression q*price/sale and have this amount as a row of a table.

thanks for your help guys.

regards

27 Replies
sunny_talwar

Would you be able to share a sample for us to look at?

Preparing examples for Upload - Reduction and Data Scrambling

Uploading a Sample

susovan
Partner - Specialist
Partner - Specialist

Hi,

Try this

Data:

LOAD op,

  q ,

price,

    sales,

    q*price/sales as @_price,

   FROM

'Give the path';

Warm Regards,
Susovan
Not applicable
Author

Hi,

thanks for your answer this is what i wanted to do.

I have one more concerne i try this script but i can't figure out why it does not load the data.

LOAD op,

  q ,

    q*price/sales as @_price, 

    price,

     sum(price ) as to price,

    sales

FROM

Table.xlsx

(ooxml, embedded labels, table is Sheet1);

thanks for your support,

Regards

Not applicable
Author

Sorry i would like to say:

LOAD op,

  q ,

    q*price/sales as @_price,

    price,

     sum(price ) as sumprice,

    sales

FROM

Table.xlsx

(ooxml, embedded labels, table is Sheet1);

i think the proble comme with the sum function on this part.

is there another way that i could use?

thanks for your support

eespiritu
Creator
Creator

Hi,

In the script when you are loading the values from the Excel file, you are applying a sum() function, you should use the Group by statement.

Regards,

Enrique.

vishsaggi
Champion III
Champion III

May be try this as Enrique suggested:

LOAD op,

         q ,

         (q*price)/sales as @_price,

         price,

         sum(price) as [to price],

         sales

FROM

Table.xlsx

(ooxml, embedded labels, table is Sheet1)

Group By op,q,price, sales;

Not applicable
Author

Hi,

I really thanks you four your support. here is my concern. For each saleop number , i have a lot of sales associated operations. I need to have the sum of the amount of the operations as a  entry variable called mont_aff.  I want the amount in Montant affaire to be in the field mont_aff. I used the script below  as you advised me. it seems like it doesn't perform the addition just the multiplication. would you have any ideas for my concern?

thanks for your support?

Regards,

LOAD

     Opération_N° as saleop,

     Mnt_Net_client as mnt,

     Qté,

     sum(Mnt_Net_client*Qté) as [mont_aff]

FROM

(biff, embedded labels, table is [data pmc $]) Group By Opération_N°,Qté, Mnt_Net_client ;

I Capturesaleop.PNGCapture_opperation.PNG

vishsaggi
Champion III
Champion III

Can you share your sample app and also your expected output you want to see if one single saleop is selected?

Not applicable
Author

This screen is exactly what i would like to perform with my datas as in this question : Dynamic variables: Use Concatenated strings as variable in script. i tried the script with my data i can't have the data populated my variable Product contains nothing

Hi,

I am a new user of qlikview. the scrip below does axactly what i would like to do.with my data. i tried it with my data but it is not working. i can't understant why:

Data:

LOAD Opération_N° as Product,

     Qté,

     Mnt_Net_client as Sale,

     TF

   //  Qté*Mnt_Net_client as [MntM] ,

  //   Qté*TF as [TFM]

FROM

(biff, embedded labels, table is Feuil2$);

Variable:

LOAD 1 as Temp

AutoGenerate(1);

for i=1 to FieldValueCount('Product')

let vProduct = FieldValue('Product','$(i)');

Concatenate(Variable)

LOAD '$(vProduct)' as PRODUCT,

      sum(Sale) as SelectedProduct,

      max(Sale) as MaxSale

Resident Data

where Product = '$(vProduct)'

Group by Product;

NEXT i

DROP Field Temp;

Capture tee.PNG