Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have the following problem:
I have a Date A and a Date B that compares to Date A and Sales with Date A and Date B.
Now I want to select Date A und and get automatically the Sales from Date A and Date B.
For example the following qvw with Inline-Data.
I tried with variable, set analysis and alternate state, but nothing was the right thing?!
Hope someone can help me!
Thanks
Christian
Hi,
Try this script
DateASales:
Load * inline
[DateA, Sales
'01.06.2015', 100,
'02.06.2015', 50,
'03.06.2015', 200,
'04.06.2015', 150,
'05.06.2015', 200,
'06.06.2015', 300,
'07.06.2015', 250,
'02.06.2014', 180,
'03.06.2014', 120,
'04.06.2014', 100,
'05.06.2014', 220,
'06.06.2014', 400,
'07.06.2014', 320,
'08.06.2014', 500];
Date:
Load * inline
[DateA, DateB,
'01.06.2015', '02.06.2014',
'02.06.2015', '03.06.2014',
'03.06.2015', '04.06.2014',
'04.06.2015', '05.06.2014',
'05.06.2015', '06.06.2014',
'06.06.2015', '07.06.2014',
'07.06.2015', '08.06.2014'];
DateBSales:
Left Keep(Date)
LOAD
DateA AS DateB,
Sales AS SalesB
RESIDENT DateASales;
In chart:
Dimensions : DateA, DateB
Expression :
SalesA = Sum(sales)
SalesB = Sum(salesB)
Regards,
Jagan.
Hi,
Try this script
DateASales:
Load * inline
[DateA, Sales
'01.06.2015', 100,
'02.06.2015', 50,
'03.06.2015', 200,
'04.06.2015', 150,
'05.06.2015', 200,
'06.06.2015', 300,
'07.06.2015', 250,
'02.06.2014', 180,
'03.06.2014', 120,
'04.06.2014', 100,
'05.06.2014', 220,
'06.06.2014', 400,
'07.06.2014', 320,
'08.06.2014', 500];
Date:
Load * inline
[DateA, DateB,
'01.06.2015', '02.06.2014',
'02.06.2015', '03.06.2014',
'03.06.2015', '04.06.2014',
'04.06.2015', '05.06.2014',
'05.06.2015', '06.06.2014',
'06.06.2015', '07.06.2014',
'07.06.2015', '08.06.2014'];
DateBSales:
Left Keep(Date)
LOAD
DateA AS DateB,
Sales AS SalesB
RESIDENT DateASales;
In chart:
Dimensions : DateA, DateB
Expression :
SalesA = Sum(sales)
SalesB = Sum(salesB)
Regards,
Jagan.
Hi,
In this instance why not use LEFT JOIN and have a single table which holds Date A, Sales A, Date B and Sales B
Hi,
If you use Left Join records will be duplicated.
Regards,
Jagan.
Hi Jagan,
thanks for your quick Answer. It works fine,
But is there a chance to get the same result without duplicate the 'DateASales'-Table?
Regards
Christian
I think this is the better approach, if you don't want that table use Left Join instead of Left Keep, I think this should also work.
If you got the answer please close this thread by giving Correct & Helpful Answers to the posts which helps you.
Regards,
Jagan.