Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How do i create a Sales Index

Hi! Im interested on creating a sales index based on year 2010. I´m using a pivot table so that rows show months and coloms show years.

Im using the following:

(Sum(Sales )) /sum( {1<YEAR= {2010} >} Sales)

But its not working, it just gives mi "1"'s in 2010 column an "-"'s in the other colums

Please help

14 Replies
daveamz
Partner - Creator III
Partner - Creator III

Hi,

Try sum(Sales)/Before(sum(Sales),ColumnNo()-1)

See the attached example.

Regards,

David

sujeetsingh
Master III
Master III

See this

Not applicable
Author

Can u post the example as an image, i cant open other .qvw as i use the trial version.

Thanks

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

You can't use set analysis here since you use Year as dimension. You need something like:

if(Year=2010,1,sum(Sales)/before(sum(Sales),Year-2010,1))


talk is cheap, supply exceeds demand
swuehl
MVP
MVP

By doing that it divides the value of each month by the whole value of the 2010, and what i want to do is this:

month(i)/month(i,year2010)

Just add your Month field (MES) to the TOTAL field list

Sum(Ventas)  / sum({1<ANO= {2010} >} TOTAL<MES> Ventas)