Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I have a project to compare the current sale dates with the previous one of the last year.
I want the days of the month March/2018 with the same of March/2017
1/3/2018 2/3/2017
2/3/2018 3/3/2017
3/3/2018 4/3/2018
.............. ............
25/3/2018 26/3/2017
-364 days and the report i want to have the following icon
Date Store Amount Amount Last Year
1/3/2018 101 1.000 1.500
If i create a variable i can only use one value. Also i don't want to create a calendar.
How can i do this. Can anyone help me ?
Thank you in advance
Hi,
You can use the function AddYear(Date,-1) to show the value one year prior and use it in a set expression;
Sum({<Date = {$(=AddYear(Date,-1))}>}Amount)
You may need to adjust the final expression based on your data model, but a version of the above should fit what you are requesting.
Hi,
by Icons, you mean textboxe's ? can you explain a little bit the objects type you're using and how you cant to display the expected result ?
Hello Niclas
The command AddYears(Date,-1) returns the same date one year before. I want to have 364 days before
lets say 24/3/2018 with 25/3/2017 Saturday with Saturday
Hello Youssef,
I want a chart with the current date and the store as dimension and the amount of current date and store as first expression and the amount of the same day 364 days before in the other expression.
if it is possible, try to attach some rows from your data
Hi,
Can't you simply add one more day after you do the Addyears(-1) function? And the 364 days are on the days that are not leap years, for those you need to go 365. Using the existing date functions in Qlikview would be more robust.
hello
wgy don't you create a history date column computed with date-364
and use a set analysis in your chart
eg: sum(<date=p(history_date )>)
Hello again,
I created variables for the previous period and i created the following command in the expression
for the current period
Sum({<SALES_YEAR={'$(=vYear)'},SALES_MONTH={'$(=vMonth)'}>} SALES)
for the previous period
sum({<SALES_DATE={'>=$(date_var_min)<=$(date_var_max)'}>}SALES)
in the dimension i have the SALES_DATE and i take the following result
SALES_DATE | AMOUNT CURRENT | AMOUNT PREVIOUS |
02/03/2017 | 0,00 | 236.607,39 |
03/03/2017 | 0,00 | 290.622,46 |
04/03/2017 | 0,00 | 440.174,21 |
06/03/2017 | 0,00 | 245.483,87 |
07/03/2017 | 0,00 | 205.953,33 |
08/03/2017 | 0,00 | 199.985,84 |
09/03/2017 | 0,00 | 206.829,82 |
10/03/2017 | 0,00 | 290.033,07 |
11/03/2017 | 0,00 | 480.385,47 |
13/03/2017 | 0,00 | 253.924,48 |
14/03/2017 | 0,00 | 207.943,25 |
15/03/2017 | 0,00 | 231.193,85 |
16/03/2017 | 0,00 | 211.188,48 |
17/03/2017 | 0,00 | 266.167,47 |
18/03/2017 | 0,00 | 425.862,44 |
20/03/2017 | 0,00 | 219.373,72 |
21/03/2017 | 0,00 | 207.900,07 |
22/03/2017 | 0,00 | 233.683,70 |
23/03/2017 | 0,00 | 268.157,03 |
24/03/2017 | 0,00 | 406.439,58 |
01/03/2018 | 231.068,68 | 0,00 |
02/03/2018 | 259.546,65 | 0,00 |
03/03/2018 | 412.769,27 | 0,00 |
05/03/2018 | 216.490,48 | 0,00 |
06/03/2018 | 178.119,50 | 0,00 |
07/03/2018 | 186.208,00 | 0,00 |
08/03/2018 | 184.047,69 | 0,00 |
09/03/2018 | 228.499,77 | 0,00 |
10/03/2018 | 354.693,33 | 0,00 |
12/03/2018 | 195.834,97 | 0,00 |
13/03/2018 | 183.747,84 | 0,00 |
14/03/2018 | 173.932,84 | 0,00 |
15/03/2018 | 191.907,44 | 0,00 |
16/03/2018 | 238.288,32 | 0,00 |
17/03/2018 | 353.843,08 | 0,00 |
19/03/2018 | 205.591,23 | 0,00 |
20/03/2018 | 185.607,20 | 0,00 |
21/03/2018 | 191.999,75 | 0,00 |
22/03/2018 | 208.905,98 | 0,00 |
23/03/2018 | 260.027,19 | 0,00 |
24/03/2018 | 350.842,02 | 0,00 |
if you see i have also the dates for the last period. i want to have only the dates for the current period and the amount for the current and previous period like this
SALES_DATE | AMOUNT CURRENT | AMOUNT PREVIOUS |
01/03/2018 | 231.068,68 | 236.607,39 |
02/03/2018 | 259.546,65 | 290.622,46 |
03/03/2018 | 412.769,27 | 440.174,21 |
05/03/2018 | 216.490,48 | 245.483,87 |
06/03/2018 | 178.119,50 | 205.953,33 |
07/03/2018 | 186.208,00 | 199.985,84 |
08/03/2018 | 184.047,69 | 206.829,82 |
09/03/2018 | 228.499,77 | 290.033,07 |
10/03/2018 | 354.693,33 | 480.385,47 |
12/03/2018 | 195.834,97 | 253.924,48 |
13/03/2018 | 183.747,84 | 207.943,25 |
14/03/2018 | 173.932,84 | 231.193,85 |
15/03/2018 | 191.907,44 | 211.188,48 |
16/03/2018 | 238.288,32 | 266.167,47 |
17/03/2018 | 353.843,08 | 425.862,44 |
19/03/2018 | 205.591,23 | 219.373,72 |
20/03/2018 | 185.607,20 | 207.900,07 |
21/03/2018 | 191.999,75 | 233.683,70 |
22/03/2018 | 208.905,98 | 268.157,03 |
23/03/2018 | 260.027,19 | 406.439,58 |
24/03/2018 | 350.842,02 | 0,00 |
how can i do this ?
Thank you in advance
Hello again,
I created variables for the previous period and i created the following command in the expression
for the current period
Sum({<SALES_YEAR={'$(=vYear)'},SALES_MONTH={'$(=vMonth)'}>} SALES)
for the previous period
sum({<SALES_DATE={'>=$(date_var_min)<=$(date_var_max)'}>}SALES)
in the dimension i have the SALES_DATE and i take the following result
SALES_DATE | AMOUNT CURRENT | AMOUNT PREVIOUS |
02/03/2017 | 0,00 | 236.607,39 |
03/03/2017 | 0,00 | 290.622,46 |
04/03/2017 | 0,00 | 440.174,21 |
06/03/2017 | 0,00 | 245.483,87 |
07/03/2017 | 0,00 | 205.953,33 |
08/03/2017 | 0,00 | 199.985,84 |
09/03/2017 | 0,00 | 206.829,82 |
10/03/2017 | 0,00 | 290.033,07 |
11/03/2017 | 0,00 | 480.385,47 |
13/03/2017 | 0,00 | 253.924,48 |
14/03/2017 | 0,00 | 207.943,25 |
15/03/2017 | 0,00 | 231.193,85 |
16/03/2017 | 0,00 | 211.188,48 |
17/03/2017 | 0,00 | 266.167,47 |
18/03/2017 | 0,00 | 425.862,44 |
20/03/2017 | 0,00 | 219.373,72 |
21/03/2017 | 0,00 | 207.900,07 |
22/03/2017 | 0,00 | 233.683,70 |
23/03/2017 | 0,00 | 268.157,03 |
24/03/2017 | 0,00 | 406.439,58 |
01/03/2018 | 231.068,68 | 0,00 |
02/03/2018 | 259.546,65 | 0,00 |
03/03/2018 | 412.769,27 | 0,00 |
05/03/2018 | 216.490,48 | 0,00 |
06/03/2018 | 178.119,50 | 0,00 |
07/03/2018 | 186.208,00 | 0,00 |
08/03/2018 | 184.047,69 | 0,00 |
09/03/2018 | 228.499,77 | 0,00 |
10/03/2018 | 354.693,33 | 0,00 |
12/03/2018 | 195.834,97 | 0,00 |
13/03/2018 | 183.747,84 | 0,00 |
14/03/2018 | 173.932,84 | 0,00 |
15/03/2018 | 191.907,44 | 0,00 |
16/03/2018 | 238.288,32 | 0,00 |
17/03/2018 | 353.843,08 | 0,00 |
19/03/2018 | 205.591,23 | 0,00 |
20/03/2018 | 185.607,20 | 0,00 |
21/03/2018 | 191.999,75 | 0,00 |
22/03/2018 | 208.905,98 | 0,00 |
23/03/2018 | 260.027,19 | 0,00 |
24/03/2018 | 350.842,02 | 0,00 |
if you see i have also the dates for the last period. i want to have only the dates for the current period and the amount for the current and previous period like this
SALES_DATE | AMOUNT CURRENT | AMOUNT PREVIOUS |
01/03/2018 | 231.068,68 | 236.607,39 |
02/03/2018 | 259.546,65 | 290.622,46 |
03/03/2018 | 412.769,27 | 440.174,21 |
05/03/2018 | 216.490,48 | 245.483,87 |
06/03/2018 | 178.119,50 | 205.953,33 |
07/03/2018 | 186.208,00 | 199.985,84 |
08/03/2018 | 184.047,69 | 206.829,82 |
09/03/2018 | 228.499,77 | 290.033,07 |
10/03/2018 | 354.693,33 | 480.385,47 |
12/03/2018 | 195.834,97 | 253.924,48 |
13/03/2018 | 183.747,84 | 207.943,25 |
14/03/2018 | 173.932,84 | 231.193,85 |
15/03/2018 | 191.907,44 | 211.188,48 |
16/03/2018 | 238.288,32 | 266.167,47 |
17/03/2018 | 353.843,08 | 425.862,44 |
19/03/2018 | 205.591,23 | 219.373,72 |
20/03/2018 | 185.607,20 | 207.900,07 |
21/03/2018 | 191.999,75 | 233.683,70 |
22/03/2018 | 208.905,98 | 268.157,03 |
23/03/2018 | 260.027,19 | 406.439,58 |
24/03/2018 | 350.842,02 | 0,00 |
how can i do this ?
Thank you in advance