Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
thanhphongle
Creator II
Creator II

query combining differents fields from 2 different columns

Asset cost
Product
1000A
25000B
8000C
4000A
15000A
12000B
500B
13000A

Hello Community, I would like to sum up every cost which refers to their own product

The query should be like this

if product=A, then sum up every asset costs referring to product A. If product= B, then sum up every asset costs referring to product B and if product C sum up every asset costs referring to product C

Qlikview should give out the result in this form

Sum Asset Cost Product A
Sum Asset Cost Product B
Sum Asset Cost Product C
33000375008000

in german

Anschaffungskosten
Produkt
1000A
25000B
8000C
4000A
15000A
12000B
500B
13000A

Hallo Community, ich würde gerne aus der obigen Tabelle, überall wo Produkt A, B oder C vorkommen die Anschaffungskosten miteinander addieren.

Die Abfrage wäre,

Wenn Produkt= A, dann addiere alle Anschaffungskosten bzgl. Produkt A, Wenn Produkt= B, dann addiere alle AK bzgl. B, wenn Produkt=C dann addiere alle AK bzgl C

Qlikview soll die Ergebnisse später in Form eines Tabellendiagramms ausgeben.

Summe Anschaffungskosten Produk A
Summe Anschaffungskosten Produk BSumme Anschaffungskosten Produk C
33000375008000
32 Replies
thanhphongle
Creator II
Creator II
Author

have you found a solution for my errors yet?

puttemans
Specialist
Specialist

Hi there,

You are loading the wrong table in the script above. In your second script string, you load from A-Import_LPM, and then you enrich with AVG_PV and Zins. In the first script string you show, you load your main table again from A-Import_LPM. Zins is not in there, and so this is the first error message you get. The other follow out of the first.

Solution is to save the result of your joins in a file, and then use this file to load your main data from. This way, zins will be there, and the script should work.

Regards,

Johan

thanhphongle
Creator II
Creator II
Author

could you show me, how my new file should look like? it is completely new for me, working/manipulating with the script.

puttemans
Specialist
Specialist

Could you upload your Qvw (that works easier than rescripting everything)

thanhphongle
Creator II
Creator II
Author

there is already one attached

puttemans
Specialist
Specialist

Please have a look at this one. Hope it will not give you the errors anymore if you can complete the sources correctly.

thanhphongle
Creator II
Creator II
Author

it is working! thank you very much

Anonymous
Not applicable

Hey..I was travelling  last week for work. I could not have a chance to get back to qlik community. I have seen someone has already helped you on this. good luck

thanhphongle
Creator II
Creator II
Author

its ok, u helped me a lot and thank you very much for your help! but could you answer on my private message please ?

Anonymous
Not applicable

I have not seen your msg, cud you send again