4 Replies Latest reply: Feb 28, 2012 8:00 AM by Alexander Gonchar

# Calculatins sales of specific hours (night sales)

There are 3 shops, saling goods.

as we have diffent taxes for nigh sales in them we need to calculate sales at night diffently.

The problem is that in every shop night time start and finish are diffent.

How cal we calculate night sales if we have start and end night hours for every shops?

Shopsnight startnight end
shop122:008:00
shop223:008:00
shop320:007:00

the main ideai is that there about30 shops and diffent night hours for each of them.

It should be a straight table with  stores in demension and calculating sales, night sales in expressions.

ShopSales only night sales
shop110\$4\$
shop224\$10\$
shop319\$8\$
• ###### Calculatins sales of specific hours (night sales)

try using interval match

• ###### Calculatins sales of specific hours (night sales)

for example?

• ###### Re: Calculatins sales of specific hours (night sales)

Hi Alex,

Please find attached logic to calculate night transaction flag. You will need to do a join of two tables i.e. Trans and NightTiming tables and create a flag fields for each transaction based on TransTime.

i have used inline tables, but pulling directly from database and calculating the flag field on fly would be pretty easy i suppose. You can also incorporate this logic in ETL layer to save time and load on QV server.

Hope this helps. Let me know if you have any questions.

• ###### Calculatins sales of specific hours (night sales)

thanks, because before that we had to calculate another table for night sales.