Skip to main content
Announcements
See why Qlik is a Leader in the 2024 Gartner® Magic Quadrant™ for Analytics & BI Platforms. Download Now
cancel
Showing results for 
Search instead for 
Did you mean: 
guillaume_gorli
Creator II
Creator II

Daily figure to apply on Monthly database

Hi all,

I need some help regarding below issue :

i have two database :

First one is a sale database per date and part number.

Fields are :

Date

Part Number

Sales

Capture.JPG

i have a second database showing a sales rebate that has to be applied to the dedicated month : for instance a rebate of 2 % has to be applied on all January sales. The tricky point here is that the key between the two tables is a day field.

Even if 2 % is linked to 31/01/2017, it has to apply to all items sold in January.

Capture.JPG

The issue i am facing is that when i build a table showing the sales (including the rebate) per part number, i only got the items sold the same day as linked with the rebate, ie 31/01/2017 for January month.

The output i get is :

Capture.JPG

Although what i shall get is :

Capture.JPG

Attached are .qvw and excel database for the ones you could help.

Thanks

1 Solution

Accepted Solutions
sunny_talwar

Check the attached

Replace

Sum([Rebate rate])

with

Sum(TOTAL [Rebate rate])

View solution in original post

5 Replies
sunny_talwar

Check the attached

Replace

Sum([Rebate rate])

with

Sum(TOTAL [Rebate rate])

guillaume_gorli
Creator II
Creator II
Author

Just perfect

Thanks Sunny

guillaume_gorli
Creator II
Creator II
Author

Sunny,

if you're still there, how would you write in a text object the formulas showing YTD total rebate ?

For instance,

January rebates are 1,18

February rebates are 2.7

March rebate are 0.21

So the text object should show :

3,88 if February is selected or 4.09 is March is selected.

I was thinking of below formulas but the output is not at all what i should get

RangeSum(Above(Sum({$<Date = {"$(='>=' & Date(YearStart(Max(Date)), 'DD/MM/YYYY') & '<=' & Date(Max(Date), 'DD/MM/YYYY'))"}, Mois, [Année]>}Sales), 0, RowNo()))

*

RangeSum(Above(Sum(TOTAL{$<Date = {"$(='>=' & Date(YearStart(Max(Date)), 'DD/MM/YYYY') & '<=' & Date(Max(Date), 'DD/MM/YYYY'))"}, Mois, [Année]>}Sales), 0, RowNo()))

sunny_talwar

Try this

=Sum({$<Date = {"$(='>=' & Date(YearStart(Max(Date)), 'DD/MM/YYYY') & '<=' & Date(Max(Date), 'DD/MM/YYYY'))"}, Mois, [Année]>}Aggr(

Sum({$<Date = {"$(='>=' & Date(YearStart(Max(Date)), 'DD/MM/YYYY') & '<=' & Date(Max(Date), 'DD/MM/YYYY'))"}, Mois, [Année]>}Sales) *

Sum({$<Date = {"$(='>=' & Date(YearStart(Max(Date)), 'DD/MM/YYYY') & '<=' & Date(Max(Date), 'DD/MM/YYYY'))"}, Mois, [Année]>}TOTAL <Année_Mois> [Rebate rate]), [Part Number], Année_Mois))

guillaume_gorli
Creator II
Creator II
Author

Thanks a lot

Guillaume