Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

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$
1 Solution

Accepted Solutions
Not applicable
Author

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.

View solution in original post

4 Replies
giakoum
Partner - Master II
Partner - Master II

try using interval match

Not applicable
Author

for example?

Not applicable
Author

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.

Not applicable
Author

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