Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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?
Shops | night start | night end |
---|---|---|
shop1 | 22:00 | 8:00 |
shop2 | 23:00 | 8:00 |
shop3 | 20:00 | 7: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.
Shop | Sales | only night sales |
---|---|---|
shop1 | 10$ | 4$ |
shop2 | 24$ | 10$ |
shop3 | 19$ | 8$ |
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.
try using interval match
for example?
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.
thanks, because before that we had to calculate another table for night sales.