14 Replies Latest reply: Jan 21, 2013 8:11 AM by Adrien BOUTREAU

# Set analysis

Hi !

I can t change the model, but i need to multiple in a pivot table a coefficient with using two different dimension for weeks

Is it possible ?

Thanks

Regards

• ###### Re: Set analysis

Hi!

got no license at the moment.

Ciao

Klaus

Start of the thread was in http://community.qlik.com/message/301641#301641

• ###### Re: Set analysis

Expressions for the two tables  :

Column 1: Count(ID_PRODUCT)

Column 2 : sum({<Week={"\$(=Week_S)"}>} Coeff)

First table : Selection on one week

Second table : No selection

• ###### Re: Set analysis

Try This:

sum({<Week={"\$(=only(Week_S))"},Week=>}Coeff)

• ###### Re: Set analysis

Thanks for the screenshots :-)

why the condition on Coeff? what's the result without that?

the conditions are done in the script, as I understood.

Ciao

Klaus

corrected

• ###### Re: Set analysis

if

it helps you then you should mark it either as helpful or correct answer,

so that it might be helpful for other developer

regards

mohit

• ###### Re: Set analysis

Hi Mohit,

it's not my thread, how should I mark as correct?

'corrected' means, that i first wrote something, that I afterwardes corrected to what you see now.

Ciao

Klaus

• ###### Re: Set analysis

in the set analysis it doesn't take the week

I want this :

ID_PRODUCT | Nb Prod -Week 1 | Coef Week 1 | Nb Prod -Week 2 | Coef Week 2 |

A | 1 | 10 | 1 | 42 |

B | - | - | 1 | 10 |

Thanks a lot again for your help

Script:

SET ThousandSep=' ';

SET DecimalSep=',';

SET MoneyThousandSep=' ';

SET MoneyDecimalSep=',';

SET MoneyFormat='# ##0,00 €;-# ##0,00 €';

SET TimeFormat='hh:mm:ss';

SET DateFormat='DD/MM/YYYY';

SET TimestampFormat='DD/MM/YYYY hh:mm:ss[.fff]';

SET MonthNames='janv.;févr.;mars;avr.;mai;juin;juil.;août;sept.;oct.;nov.;déc.';

SET DayNames='lun.;mar.;mer.;jeu.;ven.;sam.;dim.';

LET Start = Floor(MakeDate(2013,1,1));

LET End = Floor(YearEnd(Today(),1));

//Nombre de ligne à générer dans le calendrier

LET NumOfDays = End - Start + 1;

//Table temporaire pour générer le calendrier

[Date_src]:

\$(Start) + RowNo()-1 as DateID

AutoGenerate \$(NumOfDays);

Calendar:

DateID,

date(DateID, 'DD/MM/YYYY') as ID_DATE,

Month(DateID) as Month,

Week(DateID) as Week,

Year(DateID) as Year

RESIDENT Date_src;

DROP Table Date_src;

Product:

[

ID_PRODUCT, ID_DATE

A, 02/01/2013

A, 9/01/2013

B, 9/01/2013

];

Stat:

[

ID_PRODUCT, Week_S, Coeff

A, 1, 10

A, 2, 42

B, 2, 20

];

• ###### Re: Set analysis

Do you think it's possible ?

• ###### Re: Set analysis

Hi

is it just the other way round?

sum({<Week_S={\$(=only(Week))}>}Coeff)

• ###### Re: Set analysis

sorry it's not working, with this formula i allways have 0 :-(

• ###### Re: Set analysis

last try for today (I'm leaving for the weekend)

sum({<Week={'\$(=only(Week_S))'}>}Coeff)

sum({<Week_S={'\$(=only(Week))'}>}Coeff)

Ciao

Klaus

• ###### Re: Set analysis

thanks for your help but it still not working

only() not working in set analysis ?

• ###### Re: Set analysis

did you try both expressions?

edited my last post and added another expression

Wish you all the best

Klaus

• ###### Re: Set analysis

ok, I use "if" instead of the set expression and it works

Thanks all for your help !!