Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have date and region and have to sort based on date and within date sort by region
Region order would be EU, NA, and AP for each date. This I need to sort in the script
Input:
| Date | Region | Count | 
| 5/10/2022 | AP | 3 | 
| 5/12/2022 | AP | 6 | 
| 5/10/2022 | EU | 2 | 
| 5/11/2022 | EU | 2 | 
| 5/12/2022 | EU | 9 | 
| 5/10/2022 | NA | 3 | 
| 5/10/2022 | NA | 4 | 
| 5/11/2022 | NA | 1 | 
Output be like below:
| Date | Region | Count | 
| 5/10/2022 | EU | 2 | 
| 5/10/2022 | NA | 3 | 
| 5/10/2022 | NA | 4 | 
| 5/10/2022 | AP | 3 | 
| 5/11/2022 | EU | 2 | 
| 5/11/2022 | NA | 1 | 
| 5/12/2022 | EU | 9 | 
| 5/12/2022 | AP | 6 | 
Thank you, Mayil Vahanan. This I need to sort in the script.
Hi
Try like below
Temp:
Load *, Match(Region, 'EU', 'NA', 'AP') as RegionSort Inline
[
Date Region Count
5/10/2022 AP 3
5/12/2022 AP 6
5/10/2022 EU 2
5/11/2022 EU 2
5/12/2022 EU 9
5/10/2022 NA 3
5/10/2022 NA 4
5/11/2022 NA 1
](delimiter is ' ');
Final:
NoConcatenate
Load * resident Temp order by Date, RegionSort;
Drop Table Temp;
Hi 
Try like below
Thank you, Mayil Vahanan. This I need to sort in the script.
Hi
Try like below
Temp:
Load *, Match(Region, 'EU', 'NA', 'AP') as RegionSort Inline
[
Date Region Count
5/10/2022 AP 3
5/12/2022 AP 6
5/10/2022 EU 2
5/11/2022 EU 2
5/12/2022 EU 9
5/10/2022 NA 3
5/10/2022 NA 4
5/11/2022 NA 1
](delimiter is ' ');
Final:
NoConcatenate
Load * resident Temp order by Date, RegionSort;
Drop Table Temp;
I have formatted the date and used Id for region and it works.