Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
QlikView forum consolidation is complete. Labels are now required. LEARN ABOUT LABELS
cancel
Showing results for 
Search instead for 
Did you mean: 
oseimuduame
Creator II
Creator II

TOTAL SALES FILTER

Good Evening,

I want to run a report that will give me range in Total Sales of a customers, for example i should be able to click a price filter and get customers that falls under that category. The script below is what i used to determine how old an item is in my stores.

LOAD *,

  If(NDay < 32, Dual('1 Month', 1),

  If(NDay < 91, Dual('3 Months', 2),

  If(NDay < 181, Dual('6 Months', 3),

  If(NDay < 361, Dual('12 Months', 4),

  If(NDay < 541, Dual('18 Months', 5),

  If(NDay < 621, Dual('24 Months', 6),Dual('Over 2 Years', 7))))))) as DayRange;

LOAD *,

  Today() - FIRST_RCVD_DATE as NDay;

Which worked very fine i tried to apply the same method but not getting anything similar to the Result i need

LOAD *,

  If(totSales < 35000, Dual('Star', 1),

  If(totSales < 60000, Dual('Super', 2),

  If(totSales < 100000, Dual('Gallant', 3),

   Dual('Poor', 7))))as SalesPrice;

LOAD *,

  INVC_PRICE as totSales;

Any help please

3 Replies
felipedl
Partner
Partner

Hi Omotayo,

What you seem to be missing is a finalizing statement for your load

such as

Resident [Table Name]

From [File]

Autogenerate(1)  or so on to finish the load.

By doing something like:

LOAD *,

  If(totSales < 35000, Dual('Star', 1),

  If(totSales < 60000, Dual('Super', 2),

  If(totSales < 100000, Dual('Gallant', 3),

   Dual('Poor', 7))))as SalesPrice;

LOAD

  rand()*(1000000-35000) as totSales //just random numbers so that it's possible to see different categories

AutoGenerate(10);

works alright.

Hope it helps,

Felipe.

Omotayo Olokede

Anil_Babu_Samineni

How is values looks for INVC_PRICE

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
oseimuduame
Creator II
Creator II

This makes my values to zero.