Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Highlighted
Not applicable

Set analisys duplicate

Hi! im new is this group, sorry for my english.

This is my problem: I have some tables:

cars

car_states

and the value of the car, this coulb be in to tables:

car_model

car_price

The car have an identity, unique. The problem is i need sum the car's price, and sum twice because state of the car, and i can't

set distinct in set analisis because if two cars (they are unique by identity) have same price, get less the sum.

the code:

=sum( "some set analisis" if(isnull(car_price.price),car_model.price,car_price.price) )

can somebody help me? Thanks!!

6 Replies

Re: Set analisys duplicate

HI

Can you explain in brief,

Cars table contains  cars model, cars price?

Car_States table contains?

can you provide sample data?

Not applicable

Re: Set analisys duplicate

Hi!

Examples

cars (icar,desc,idmodel)

car_states (idcar,state_desc)

car_model (idmodel, model_desc)

car_price (idcar, price_car)

thanks!!

Re: Set analisys duplicate

Hi Patrick,

Can you please provide a sample qv file which contains dummy data. Need a relation ship between tables and values in it. Without knowing the data structure, its difficult to find the solution..

Can you provide a sample data? and expected results?

Not applicable

Re: Set analisys duplicate

Please, see the excel attached, in the sheet example there are the tables and in the other sheet(Notes) there are some stuff...

Thanks again!!!

somenathroy
Contributor III

Re: Set analisys duplicate

Pls. find the attached QVW. hope it helps.

Regards,

Som

Not applicable

Re: Set analisys duplicate

Guys, i resolved the problem :

=sum( $(vFiltroStockA) EstadoUnidad = {'Sin Asignar'}, VariableNombre = {'Linea Barco'}, [Tipo Unidad] = {'Propias'}>} aggr(if(num(LBMes) = num(month(today())-1) and isnull(ReservaDia) , $(vCostoConIVA)),IDFabrica ))

aggr was the solution, it returns a distinct idcar and i do the sum OK!

BUT,  in the set analisys, i use anothers fields from the app and the problems is that this impact in my graph...

how can i use set analisys with aggr??????