Skip to main content
Announcements
Qlik Community Office Hours, March 20th. Former Talend Community users, ask your questions live. SIGN UP
cancel
Showing results for 
Search instead for 
Did you mean: 
camilo
Contributor III
Contributor III

Same Store Sale Indicator

Hi, I´m trying to create a SSS indicator (on a pivot table) to compare sales 364 days after the selected date, something like:

sum sales if 364 day ago Sales<>0

How can I create this value? please any help is more than welcome.

Thanks,

Camilo

21 Replies
camilo
Contributor III
Contributor III
Author

Mmm I added Mes and Año to de group clause but nothing happen, if I dont have a Date but Year (2008, 2009, 2010... etc) and month (1, 2, 3... 12) only, how should I write the script?  I´m trying something like:

SSSSales:

LOAD AñoMes,

Año,

Mes,

Local,

Local &'-'& num(AñoMes) as LocalDate,

sum(Real) as SumSales

resident Data group by Local, AñoMes, Año, Mes;

SSSDates:

left join (Data) Load AñoMes, Local, Año, Mes,

if (Lookup('SumSales','LocalDate',Local&'-'&num(Año-1) &'-'& num(Mes),'SSSSales')>0, 1) as SSS

Resident SSSSales;

drop table SSSSales;

swuehl
MVP
MVP

What do you mean with nothing happen? Do you still get a script error? Can you tell at which part line (e.g. by commenting some parts out?

Then, check if your SSSSales table is built correctly (by commenting out the SSSDates table load and the drop table). One step after the other.

Then, check that your format of AnoMes used for LocalDate in SSSSales and  the lookup in SSSDates are identical, e.g. by putting

Local&'-'&num(Año-1) &'-'& num(Mes) as LocalDateprev

in the SSSSales table, just for inspection.