Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

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

1 Solution

Accepted Solutions
Not applicable
Author

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

Thanks all for your help !!

View solution in original post

14 Replies
Not applicable
Author

Hi!

got no license at the moment.

So what's in your qvw?

Ciao

Klaus

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

Not applicable
Author

1.png

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

er_mohit
Master II
Master II

Try This:

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

Not applicable
Author

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

er_mohit
Master II
Master II

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

Not applicable
Author

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.

But thanks for asking, so I tried the 'like'-button and it shows as 'Helpful Answer'

Ciao

Klaus

Not applicable
Author

thanks for your answers but it doesn't work

in the set analysis it doesn't take the week

1.png

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]:

LOAD

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

AutoGenerate $(NumOfDays);

Calendar:

LOAD

          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:

Load * Inline

[

          ID_PRODUCT, ID_DATE

          A, 02/01/2013

          A, 9/01/2013

          B, 9/01/2013

];

Stat:

load * Inline

[

          ID_PRODUCT, Week_S, Coeff

          A, 1, 10

          A, 2, 42

          B, 2, 20

];

Not applicable
Author

Do you think it's possible ?

Not applicable
Author

Hi

is it just the other way round?

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