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

Create a new field in script using fields of different tables

Hi,

I am use a Qlikview which loads fields from different files. I have a file that has the inventory of every month, i load one table per month:

LOAD Año,

Mes,

Materiale,

[Qtà stk. val.],

[Valore stk. v.]

FROM

(ooxml, embedded labels, table is [Inventario mes])

Also i have a file that loads the sells of every month per product:

LOAD Materiale,

IF(WildMatch([Anno cal./mese],'GEN*'), 'Enero',

IF(WildMatch([Anno cal./mese],'FEB*'), 'Febrero',

IF(WildMatch([Anno cal./mese],'MAR*'), 'Marzo',

IF(WildMatch([Anno cal./mese],'APR*'), 'Abril',

IF(WildMatch([Anno cal./mese],'MAG*'), 'Mayo',

IF(WildMatch([Anno cal./mese],'GIU*'), 'Junio',

IF(WildMatch([Anno cal./mese],'LUG*'), 'Julio',

IF(WildMatch([Anno cal./mese],'AGO*'), 'Agosto',

IF(WildMatch([Anno cal./mese],'SET*'), 'Septiembre',

IF(WildMatch([Anno cal./mese],'OTT*'), 'Octubre',

IF(WildMatch([Anno cal./mese],'NOV*'), 'Noviembre',

IF(WildMatch([Anno cal./mese],'DIC*'), 'Diciembre','ERROR')))))))))))) as Mes,

IF(WildMatch([Anno cal./mese],'*200*') or WildMatch([Anno cal./mese],'*199*'),'Antiguo',

IF(WildMatch([Anno cal./mese],'*2010'),'2010',

IF(WildMatch([Anno cal./mese],'*2011'),'2011',

IF(WildMatch([Anno cal./mese],'*2012'),'2012',

IF(WildMatch([Anno cal./mese],'*2013'),'2013',

IF(WildMatch([Anno cal./mese],'*2014'),'2014',

IF(WildMatch([Anno cal./mese],'*2015'),'2015','Actualizar Scrpit'))))))) as Año,

[Quantità PF] as Venta,

[Luogo di spedizione]

FROM

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

I want to create a field called 'Rotación' which is calculated as: --> (Venta/[Qtà stk. val.])

This field 'Rotación' has to be the sales (Venta) of a specific Year(Año) & Month(Mes) divided by the stock amount ([Qtà stk. val.]) of the same Year & Month. Also observe that the Month & Year, in the sales file, are calculated fields (to make it them same format as the month in the inventory file)

As the two fields that appear in the formula are provided from different files, i don't know how to make it in the script. Help!

Thanks for your time!!



3 Replies
Not applicable
Author

Hello,

Why do you want to do this in your script and not in Qlikview itself?

Kind Regards,

Martijn

sushil353
Master II
Master II

hi,

can u a little bit more clear about your requirement.

Not applicable
Author

My intention is to create a field "Rotación" calculated like:

(sum({<[Luogo spedizione]={'6a01'}>}Venta)/sum([Qtà stk. val.]))

The problem is that the two fields used in the expression are being loaded from different tables.

How should i introduce the expression and where??

Thanks for your time!