Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Not applicable

Script Help.

Hi,

Help me am facing syntax errore:

1)Count of Customer Who Made Sales  ie when flag =1 and count 0f flag=0

2)Total Revenue of last year in Percentage

3)Count of Dealers In Year (2010) where sales flag =1

Tags (1)
1 Solution

Accepted Solutions
Not applicable

Re: Script Help.

Please find below:

Question1:

='1)Count of Customer Who Made Sales when Flag =1 : ' & Count({<Sales_Flage={1}>}Customer_Code)

='1)Count of Customer Who Made Sales when Flag =0 : ' & Count({<Sales_Flage={0}>}Customer_Code)

Question2:

='2)Total Revenue of last year in Percentage : ' & Num(sum({<Year={2010}>}Gross_Sale-Discount)/sum({<Year={2010}>}Gross_Sale),'###0.00%')


Question3:

='3)Count of Dealers In Year (2010) where sales flag =1' & Count({<Sales_Flage={1},Category={"Drealer"},Year={2010}>} DISTINCT Customer_Code)

View solution in original post

2 Replies
Not applicable

Re: Script Help.

Please find below:

Question1:

='1)Count of Customer Who Made Sales when Flag =1 : ' & Count({<Sales_Flage={1}>}Customer_Code)

='1)Count of Customer Who Made Sales when Flag =0 : ' & Count({<Sales_Flage={0}>}Customer_Code)

Question2:

='2)Total Revenue of last year in Percentage : ' & Num(sum({<Year={2010}>}Gross_Sale-Discount)/sum({<Year={2010}>}Gross_Sale),'###0.00%')


Question3:

='3)Count of Dealers In Year (2010) where sales flag =1' & Count({<Sales_Flage={1},Category={"Drealer"},Year={2010}>} DISTINCT Customer_Code)

View solution in original post

MVP
MVP

Re: Script Help.

1)

count({<Sales_Flage={1},Year={$(=max(Year))}>} distinct Customer_Code)

count({<Sales_Flage={0},Year={$(=max(Year))}>} distinct Customer_Code)


or without the year filter

count({<Sales_Flage={1}>} distinct Customer_Code)

count({<Sales_Flage={0}>} distinct Customer_Code)


2)


maybe

num(

     sum({$<Year={'$(=Max(Year))'}>}  (Gross_Sale-Discount))

     / sum({$<Year={'$(=Max(Year)-1)'}>}  (Gross_Sale-Discount)) -1

, '#,##0.0%')



3)

for the count of dealer here

=count({$<[Category]={'Dealer'}>})

1.png

you need a field

=count({$<[Category]={Dealer},Year={2010}>} distinct Customer_Code)

or

count({<Category={Dealer},Year={$(=max(Year))}>} distinct Customer_Code)