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

sales calculation if condition

Hi Experts,

i have the following tables,

CUSTOMER:

LOAD Branch,

         CUSTNO,

     Total_Target,

     Daily_Target

  

FROM

QVD\CUSTOMER.qvd

(qvd);

SALES:

LOAD Branch,

   Date,

   Branch as Branch1,

       Date as Date1,

     CUSTNO,

     SalesValue

   

FROM

QVD\Sales.qvd

(qvd);

WorkingDays:

  LOAD  Branch as Branch1,

             Date as Date1,

      WorkingDays

     

        FROM

        [\\QVDs\CALENDAR.qvd]

        (qvd)

And also i have master calendar associated with sales table.

i have to give the summary of sales like below

summary1.JPG

i need to use the condition like,

if (sales/workingdays) > Daily_Target , then only for that customers, the sales summary has to be dispalyed on the table. but the table shouldn't include CUSTNO as dimension.

How can i do this.

pls help me on this

1 Solution

Accepted Solutions
jagan
Partner - Champion III
Partner - Champion III

Hi,

Try like this using Aggr()

Dimension: Month

Expression:

Total Sales: Sum(Aggr(if (Sum(sales)/Sum(workingdays) > Only(Daily_Target), Sum(Sales)), Customer))

Working Days: Sum(Aggr(if (Sum(sales)/Sum(workingdays) > Only(Daily_Target), Sum(Sales)), Customer))

Hope this helps you.

Regards,

Jagan.

View solution in original post

3 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

Kindly update some sample data.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
jagan
Partner - Champion III
Partner - Champion III

Hi,

Try like this using Aggr()

Dimension: Month

Expression:

Total Sales: Sum(Aggr(if (Sum(sales)/Sum(workingdays) > Only(Daily_Target), Sum(Sales)), Customer))

Working Days: Sum(Aggr(if (Sum(sales)/Sum(workingdays) > Only(Daily_Target), Sum(Sales)), Customer))

Hope this helps you.

Regards,

Jagan.

Not applicable
Author

thanks jagan